Skip to content
Merged
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: 25 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ incremental = false
[workspace.dependencies]
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
Expand Down Expand Up @@ -72,6 +73,7 @@ reth-revm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-payload-builder-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.12" }

# reth optimism
Expand Down
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,40 @@ cargo run -- spam ./scenarios/simple.toml http://localhost:2222 --tpb 10 --durat
```

And you should start to see blocks being built and landed on-chain with `contender` transactions.


## Builder playground

You can quickly spin up an op-stack devnet using [builder-playground](https://github.com/flashbots/builder-playground). The quickest workflow to get op-stack running against your local `op-rbuilder` instance is:

1. Check out the builder playground repo

```
git clone git@github.com:flashbots/builder-playground.git
```

2. In the builder-playgound spin up an l2 opstack setup specifying that it should use an external block builder:

```
go run main.go cook opstack --external-builder http://host.docker.internal:4444
```

3. Run rbuilder in playground mode:

```
cargo run --bin op-rbuilder -- node --builder.playground
```

You could also run it using:

```
just run-playground
```


This will automatically try to detect all settings and ports from the currently running playground. Sometimes you might need to clean up the builder-playground state between runs. This can be done using:

```
rm -rf ~/.local/share/reth
sudo rm -rf ~/.playground
```
6 changes: 6 additions & 0 deletions crates/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ reth-optimism-evm.workspace = true
reth-optimism-consensus.workspace = true
reth-optimism-primitives.workspace = true
reth-optimism-txpool.workspace = true
reth-cli.workspace = true
reth-cli-util.workspace = true
reth-payload-primitives.workspace = true
reth-evm.workspace = true
Expand All @@ -38,6 +39,7 @@ reth-rpc-layer.workspace = true
reth-payload-builder-primitives.workspace = true
reth-payload-util.workspace = true
reth-transaction-pool.workspace = true
reth-network-peers.workspace = true
reth-testing-utils.workspace = true
reth-optimism-forks.workspace = true

Expand Down Expand Up @@ -81,13 +83,17 @@ serde_json.workspace = true
tokio-util.workspace = true
thiserror.workspace = true
parking_lot.workspace = true
url.workspace = true

time = { version = "0.3.36", features = ["macros", "formatting", "parsing"] }
chrono = "0.4"
uuid = { version = "1.6.1", features = ["serde", "v5", "v4"] }
tokio-tungstenite = "0.26.2"
rand = "0.9.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }
shellexpand = "3.1"
serde_yaml = { version = "0.9" }


# `flashblocks` branch
rollup-boost = { git = "http://github.com/flashbots/rollup-boost", rev = "60885346d4cf7f241de82790478195747433d472" }
Expand Down
5 changes: 5 additions & 0 deletions crates/op-rbuilder/src/args/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
mod op;
mod playground;

pub use op::OpRbuilderArgs;
pub use playground::CliExt;
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//! Copied from OptimismNode to allow easy extension.

//! clap [Args](clap::Args) for optimism rollup configuration
use std::path::PathBuf;

use reth_optimism_node::args::RollupArgs;

use crate::tx_signer::Signer;
Expand Down Expand Up @@ -41,10 +43,28 @@ pub struct OpRbuilderArgs {
/// Signals whether to log pool transaction events
#[arg(long = "builder.log-pool-transactions", default_value = "false")]
pub log_pool_transactions: bool,

/// How much time extra to wait for the block building job to complete and not get garbage collected
#[arg(long = "builder.extra-block-deadline-secs", default_value = "20")]
pub extra_block_deadline_secs: u64,
/// Whether to enable revert protection by default
#[arg(long = "builder.enable-revert-protection", default_value = "false")]
pub enable_revert_protection: bool,

#[arg(
long = "builder.playground",
num_args = 0..=1,
default_missing_value = "$HOME/.playground/devnet/",
value_parser = expand_path,
env = "PLAYGROUND_DIR",
)]
pub playground: Option<PathBuf>,
}

fn expand_path(s: &str) -> Result<PathBuf, String> {
shellexpand::full(s)
.map_err(|e| format!("expansion error for `{s}`: {e}"))?
.into_owned()
.parse()
.map_err(|e| format!("invalid path after expansion: {e}"))
}
Loading
Loading