Skip to content

refactor: Block Builder Executor #524

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
2,120 changes: 1,145 additions & 975 deletions Cargo.lock

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -18,7 +18,11 @@ members = [
"crates/sysperf",
"crates/test-relay",
]
default-members = ["crates/rbuilder", "crates/reth-rbuilder", "crates/test-relay"]
default-members = [
"crates/rbuilder",
"crates/reth-rbuilder",
"crates/test-relay",
]
resolver = "2"

# Like release, but with full debug symbols. Useful for e.g. `perf`.
@@ -41,6 +45,7 @@ reth-db-common = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-trie = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
reth-trie-parallel = { git = "https://github.com/paradigmxyz/reth", tag = "v1.3.4" }
@@ -115,16 +120,17 @@ alloy-genesis = { version = "0.12.6" }
alloy-trie = { version = "0.7.9" }

# optimism
alloy-op-evm = { version = "0.1.0-alpha.2", default-features = false }
alloy-op-evm = { version = "0.1.0-alpha.3", default-features = false }
alloy-op-hardforks = { version = "0.1.0-alpha.2", default-features = false }
op-alloy-rpc-types = { version = "0.11.2", default-features = false }
op-alloy-rpc-types-engine = { version = "0.11.2", default-features = false }
op-alloy-rpc-jsonrpsee = { version = "0.11.2", default-features = false }
op-alloy-network = { version = "0.11.2", default-features = false }
op-alloy-consensus = { version = "0.11.2", default-features = false }

# kona
kona-rpc = { git = "https://github.com/op-rs/kona", rev = "0493d8479e2ca9f0eb6d5c6154e2bedc61de7217", features = ["client", "interop", "jsonrpsee"] }
kona-interop = { git = "https://github.com/op-rs/kona", rev = "0493d8479e2ca9f0eb6d5c6154e2bedc61de7217" }
kona-rpc = { git = "https://github.com/op-rs/kona", rev = "88efce85a96a0dbc98c8aab94dd18d2136498fb0", features = ["client", "interop", "jsonrpsee"] }
kona-interop = { git = "https://github.com/op-rs/kona", rev = "88efce85a96a0dbc98c8aab94dd18d2136498fb0" }

async-trait = { version = "0.1.83" }
clap = { version = "4.4.3", features = ["derive", "env"] }
@@ -161,4 +167,8 @@ time = { version = "0.3.36", features = ["macros", "formatting", "parsing"] }
eth-sparse-mpt = { path = "crates/eth-sparse-mpt" }
rbuilder = { path = "crates/rbuilder" }
sysperf = { path = "crates/sysperf" }
metrics_macros = { path = "crates/rbuilder/src/telemetry/metrics_macros"}
metrics_macros = { path = "crates/rbuilder/src/telemetry/metrics_macros" }

[patch.crates-io]
alloy-op-evm = { git = "https://github.com/avalonche/evm", rev = "ccaaa18d3f45d03deaa2e8f9020aa7d695e2b471", default-features = false }
alloy-evm = { git = "https://github.com/avalonche/evm", rev = "ccaaa18d3f45d03deaa2e8f9020aa7d695e2b471", default-features = false }
2 changes: 1 addition & 1 deletion crates/eth-sparse-mpt/src/reth_sparse_trie/change_set.rs
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};

use crate::ChangedAccountData;

#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ETHTrieChangeSet {
pub account_trie_deletes: Vec<Bytes>,

6 changes: 5 additions & 1 deletion crates/op-rbuilder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@ reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-node-api.workspace = true
reth-node-builder.workspace = true
reth-basic-payload-builder.workspace = true
reth-payload-builder.workspace = true
reth-node-ethereum.workspace = true
@@ -58,14 +59,16 @@ alloy-serde.workspace = true
alloy-op-evm.workspace = true
op-alloy-consensus.workspace = true
op-alloy-rpc-types-engine.workspace = true
op-alloy-rpc-types.workspace = true
op-alloy-network.workspace = true
op-revm.workspace = true
alloy-op-hardforks.workspace = true

# kona
kona-rpc.workspace = true
kona-interop.workspace = true

revm.workspace = true
op-revm.workspace = true

tracing.workspace = true
futures-util = "0.3.31"
@@ -83,6 +86,7 @@ derive_more.workspace = true
metrics.workspace = true
serde_json.workspace = true
tokio-util.workspace = true
thiserror.workspace = true

time = { version = "0.3.36", features = ["macros", "formatting", "parsing"] }
chrono = "0.4"
12 changes: 6 additions & 6 deletions crates/op-rbuilder/README.md
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ To run op-rbuilder with the op-stack, you need:
To run the op-rbuilder, run:

```bash
cargo run -p op-rbuilder --bin op-rbuilder --features optimism -- node \
cargo run -p op-rbuilder --bin op-rbuilder -- node \
--chain /path/to/chain-config.json \
--http \
--authrpc.port 9551 \
@@ -24,7 +24,7 @@ cargo run -p op-rbuilder --bin op-rbuilder --features optimism -- node \
To build the op-rbuilder, run:

```bash
cargo build -p op-rbuilder --bin op-rbuilder --features optimism
cargo build -p op-rbuilder --bin op-rbuilder
```

## Observability
@@ -50,13 +50,13 @@ To run the integration tests, run:

```bash
# Generate a genesis file
cargo run -p op-rbuilder --bin tester --features optimism -- genesis --output genesis.json
cargo run -p op-rbuilder --bin tester -- genesis --output genesis.json

# Build the op-rbuilder binary
cargo build -p op-rbuilder --bin op-rbuilder --features optimism
cargo build -p op-rbuilder --bin op-rbuilder

# Run the integration tests
cargo run -p op-rbuilder --bin tester --features optimism -- run
cargo run -p op-rbuilder --bin tester -- run
```

## Local Devnet
@@ -86,7 +86,7 @@ make devnet-clean && make devnet-down && make devnet-up
4. Run `op-rbuilder` in the `rbuilder` repo on port 8547:

```bash
cargo run -p op-rbuilder --bin op-rbuilder --features optimism -- node \
cargo run -p op-rbuilder --bin op-rbuilder -- node \
--chain ../optimism/.devnet/genesis-l2.json \
--http \
--http.port 8547 \
4 changes: 2 additions & 2 deletions crates/op-rbuilder/src/args.rs
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
//! clap [Args](clap::Args) for optimism rollup configuration
use reth_optimism_node::args::RollupArgs;

use crate::tx_signer::Signer;
use crate::tx_signer::OpSigner;
use alloy_transport_http::reqwest::Url;

/// Parameters for rollup configuration
@@ -17,7 +17,7 @@ pub struct OpRbuilderArgs {
pub rollup_args: RollupArgs,
/// Builder secret key for signing last transaction in block
#[arg(long = "rollup.builder-secret-key", env = "BUILDER_SECRET_KEY")]
pub builder_signer: Option<Signer>,
pub builder_signer: Option<OpSigner>,
/// Websocket port for flashblock payload builder
#[arg(
long = "rollup.flashblocks-ws-url",
Loading