Skip to content
Open
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
168 changes: 48 additions & 120 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
[workspace]
members = [
".", # The main rblib library
"src/pipelines/macros",
"src/test_utils/macros",
]
resolver = "2"

[workspace.package]
version = "0.4.1"
edition = "2024"
rust-version = "1.91"
rust-version = "1.92"
license = "MIT"
homepage = "https://github.com/flashbots/rblib"
repository = "https://github.com/flashbots/rblib"
authors = ["Flashbots <[email protected]>", "Karim Agha <[email protected]>"]
authors = ["Flashbots <[email protected]>", "Karim Agha <[email protected]>", "Jules Doumeche <[email protected]>"]
exclude = [".github/"]

[workspace]
members = [
"crates/rblib",
"crates/core",
"crates/pipeline",
"crates/pipeline-macros",
"crates/test-utils-macros",
]
resolver = "2"

[workspace.lints.rust]
type_alias_bounds = "allow"
unreachable_pub = "warn"
Expand All @@ -33,73 +35,8 @@ cast_precision_loss = "allow"
[workspace.metadata.scripts]
lint = "cargo clippy --all-targets -- -D warnings"

[package]
name = "rblib"
description = "Modular SDK for building ethereum block builders."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
exclude.workspace = true

[lib]
doctest = false

[features]
default = ["optimism", "jemalloc"]

jemalloc = [
"dep:tikv-jemallocator",
"reth-origin/jemalloc",
"reth-optimism-cli?/jemalloc",
]

jemalloc-prof = [
"jemalloc",
"tikv-jemallocator?/profiling",
"reth-origin/jemalloc-prof",
]

optimism = [
"op-alloy",
"op-alloy-rpc-types-engine",
"reth-optimism-node",
"reth-optimism-chainspec",
"reth-optimism-forks",
"reth-optimism-primitives",
"reth-optimism-txpool",
"reth-optimism-rpc",
"reth-optimism-consensus",
"reth-optimism-evm",
"reth-node-builder/op",
"reth-payload-util",
"reth-optimism-cli",
"rblib-tests-macros?/optimism",
]

test-utils = [
"nanoid",
"tokio/full",
"alloy-genesis",
"reth-ipc",
"reth-ethereum/test-utils",
"reth-optimism-rpc/client",
"rblib-tests-macros",
"jsonrpsee-core",
"tracing-subscriber",
"ctor",
]

long-pipelines-syntax = []

[dependencies]
# internal dependencies
pipelines-macros = { path = "src/pipelines/macros" }

# Common dependencies
[workspace.dependencies]
# Common
itertools = "0.14"
eyre = "0.6"
thiserror = "2.0"
Expand All @@ -118,16 +55,13 @@ metrics = "0.24.0"
priority-queue = "2.0.0"
rand = "0.9"

# Alloy dependencies
alloy-origin = { version = "1.0.41", package = "alloy", features = [
"k256",
"rpc-types-mev",
] }
# Alloy
alloy-origin = { version = "1.0.41", package = "alloy", features = ["k256", "rpc-types-mev"] }
alloy-evm = "0.23.0"
alloy-serde = "1.0.41"
alloy-json-rpc = "1.0.41"

# Reth dependencies
# Reth
reth-origin = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", package = "reth" }
reth-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
Expand All @@ -137,10 +71,7 @@ reth-rpc-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = [
"node",
"evm",
] }
reth-ethereum = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = ["node", "evm"] }
reth-network-peers = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
Expand All @@ -150,48 +81,45 @@ reth-node-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-metrics = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-provider = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-ipc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-ipc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-tracing-otlp = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-eth-wire-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-network = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-db-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }

# Revm dependencies
# Revm
revm-database = "9.0"

# Reth-optimism dependencies (optional)
op-alloy = { version = "0.22.4", features = ["full"], optional = true }
op-alloy-rpc-types-engine = { version = "0.22.4", default-features = false, optional = true }
# Reth-optimism
op-alloy = { version = "0.22.4", features = ["full"] }
op-alloy-rpc-types-engine = { version = "0.22.4", default-features = false }
op-alloy-flz = "0.13.1"
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-txpool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", optional = true }

# test-utils
rblib-tests-macros = { path = "src/test_utils/macros", optional = true }
jsonrpsee-core = { version = "0.26.0", optional = true, features = ["client"] }
nanoid = { version = "0.4", optional = true }
alloy-genesis = { version = "1.0", default-features = false, optional = true }
ctor = { version = "0.5", optional = true }
tracing-subscriber = { version = "0.3.20", features = [
"env-filter",
"json",
], optional = true }

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { version = "0.6", optional = true }

[dev-dependencies]
rblib = { path = ".", features = ["test-utils"] }
reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-chainspec = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-forks = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-txpool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-consensus = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-payload-util = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-cli = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
reth-optimism-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }

[lints]
workspace = true
# test-utils
jsonrpsee-core = { version = "0.26.0", features = ["client"] }
nanoid = "0.4"
alloy-genesis = { version = "1.0", default-features = false }
ctor = "0.5"
tracing-subscriber = { version = "0.3.20", features = ["env-filter", "json"] }

# unix-only allocator
tikv-jemallocator = "0.6"

# macro
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full"] }
proc-macro-crate = "3.3.0"
115 changes: 115 additions & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
[package]
name = "rblib-core"
description = "Modular Payload SDK for building ethereum block builders."
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
authors.workspace = true
exclude.workspace = true

[lints]
workspace = true

[lib]
doctest = false

[features]
default = ["optimism", "jemalloc"]
jemalloc = ["dep:tikv-jemallocator", "reth-origin/jemalloc"]
jemalloc-prof = ["jemalloc", "tikv-jemallocator?/profiling", "reth-origin/jemalloc-prof"]

optimism = [
"dep:op-alloy",
"dep:op-alloy-rpc-types-engine",
"dep:reth-optimism-node",
"dep:reth-optimism-chainspec",
"dep:reth-optimism-forks",
"dep:reth-optimism-primitives",
"dep:reth-optimism-txpool",
"dep:reth-optimism-rpc",
"dep:reth-optimism-consensus",
"dep:reth-optimism-evm",
"dep:reth-payload-util",
"dep:reth-optimism-cli",
"dep:op-alloy-flz"
]

test-utils = [
"reth-ethereum/test-utils",
"dep:alloy-genesis"
]

[target.'cfg(unix)'.dependencies]
tikv-jemallocator = { workspace = true, optional = true }

[dependencies]
# Common
itertools.workspace = true
thiserror.workspace = true
tracing.workspace = true
dashmap.workspace = true
uuid.workspace = true
serde.workspace = true
metrics.workspace = true

# test utils
rand.workspace = true
eyre.workspace = true

# Alloy
alloy-origin.workspace = true
alloy-evm.workspace = true
alloy-serde.workspace = true

# Reth
reth-origin.workspace = true
reth-evm.workspace = true
reth-errors.workspace = true
reth-cli.workspace = true
reth-cli-commands.workspace = true
reth-rpc-eth-types.workspace = true
reth-basic-payload-builder.workspace = true
reth-ethereum-payload-builder.workspace = true
reth-ethereum.workspace = true
reth-network-peers.workspace = true
reth-transaction-pool.workspace = true
reth-payload-builder.workspace = true
reth-payload-primitives.workspace = true
reth-node-builder.workspace = true
reth-node-api.workspace = true
reth-chainspec.workspace = true
reth-metrics.workspace = true
reth-provider.workspace = true
reth-tracing-otlp.workspace = true
reth-db.workspace = true
reth-eth-wire-types.workspace = true
reth-network.workspace = true
reth-node-types.workspace = true

# Revm
revm-database.workspace = true

# Optimism (optional)
op-alloy = { workspace = true, optional = true }
op-alloy-rpc-types-engine = { workspace = true, optional = true }

reth-optimism-node = { workspace = true, optional = true }
reth-optimism-chainspec = { workspace = true, optional = true }
reth-optimism-forks = { workspace = true, optional = true }
reth-optimism-rpc = { workspace = true, optional = true }
reth-optimism-txpool = { workspace = true, optional = true }
reth-optimism-consensus = { workspace = true, optional = true }
reth-optimism-evm = { workspace = true, optional = true }
reth-payload-util = { workspace = true, optional = true }
reth-optimism-cli = { workspace = true, optional = true }
reth-optimism-primitives = { workspace = true, optional = true }
op-alloy-flz = { workspace = true, optional = true }

# test utils
alloy-genesis = { workspace = true, optional = true }

[dev-dependencies]
rblib-core = { path = ".", features = ["test-utils"] }
41 changes: 14 additions & 27 deletions src/lib.rs → crates/core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,38 +1,25 @@
// core modules, partially re-exported through `rblib::prelude`
mod payload;
mod pipelines;
mod platform;
// Core payload API and platform abstractions.
pub mod payload;
pub mod platform;

// RBLib Core Public API Prelude
pub mod prelude {
pub use {
super::{payload::*, pipelines::*, platform::*},
metrics::{Counter, Gauge, Histogram},
pipelines_macros::MetricsSet,
};

pub(crate) use super::Variant;
}
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;

#[doc(hidden)]
pub mod metrics_util {
pub use metrics::*;
}

/// Order Pool Public API
pub mod pool;

/// Common steps library
pub mod steps;

/// Orderpool utils
pub mod orderpool2;

// Externally available test utilities
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;
pub mod prelude {
pub(crate) use super::Variant;
pub use super::{
metrics_util::{Counter, Gauge, Histogram},
payload::*,
platform::*,
};
}

// Reexport reth version that is used by rblib as a convenience for downstream
// Reexport reth version used by rblib as a convenience for downstream
// users. Those exports should be enough to get started with a simple node.
pub mod reth {
pub use reth_origin::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use {
api::ConfigureEvm,
errors::ProviderError,
evm::{block::BlockExecutionError, execute::BlockBuilder},
payload::builder::PayloadBuilderError,
primitives::SealedHeader,
providers::{StateProvider, StateProviderBox, StateProviderFactory},
revm::{State, database::StateProviderDatabase},
Expand Down
Loading
Loading