diff --git a/Cargo.lock b/Cargo.lock index 094985e3..8286332f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7547,6 +7547,7 @@ dependencies = [ "alloy-transport-http", "anyhow", "async-trait", + "base-bundles", "chrono", "clap", "clap_builder", @@ -7645,7 +7646,6 @@ dependencies = [ "thiserror 2.0.17", "tikv-jemallocator", "time", - "tips-core", "tokio", "tokio-tungstenite 0.26.2", "tokio-util", @@ -13981,23 +13981,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "tips-core" -version = "0.1.0" -source = "git+https://github.com/base/tips?rev=c08eaa4fe10c26de8911609b41ddab4918698325#c08eaa4fe10c26de8911609b41ddab4918698325" -dependencies = [ - "alloy-consensus", - "alloy-primitives 1.5.2", - "alloy-provider", - "alloy-serde", - "op-alloy-consensus", - "op-alloy-flz", - "serde", - "tracing", - "tracing-subscriber 0.3.22", - "uuid", -] - [[package]] name = "tokio" version = "1.49.0" diff --git a/Cargo.toml b/Cargo.toml index 81155f65..6cb5e776 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -84,7 +84,9 @@ reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" reth-rpc-convert = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } reth-rpc-api = { 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-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = ["client"] } +reth-optimism-rpc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = [ + "client", +] } reth-optimism-evm = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } reth-optimism-node = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } @@ -94,7 +96,9 @@ reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9. reth-primitives-traits = { 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-primitives = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } -reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = ["op"] } +reth-db = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3", features = [ + "op", +] } reth-chain-state = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } reth-errors = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } reth-payload-builder = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } @@ -125,7 +129,11 @@ reth-optimism-payload-builder = { git = "https://github.com/paradigmxyz/reth", t reth-optimism-txpool = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" } # revm -revm = { version = "31.0.2", features = ["std", "secp256k1", "optional_balance_check"], default-features = false } +revm = { version = "31.0.2", features = [ + "std", + "secp256k1", + "optional_balance_check", +], default-features = false } revm-bytecode = { version = "7.1.1", default-features = false } revm-inspectors = { version = "0.32.0", default-features = false } revm-database = { version = "9.0.5", default-features = false } @@ -147,11 +155,18 @@ alloy-genesis = "1.0.41" alloy-signer = "1.0.41" alloy-signer-local = "1.0.41" alloy-hardforks = "0.4.4" -alloy-provider = { version = "1.0.41", features = ["ipc", "pubsub", "txpool-api", "engine-api"] } +alloy-provider = { version = "1.0.41", features = [ + "ipc", + "pubsub", + "txpool-api", + "engine-api", +] } alloy-contract = "1.0.41" alloy-sol-types = { version = "1.4.1", features = ["json"] } alloy-sol-macro = "1.4.1" -alloy-primitives = { version = "1.4.1", default-features = false, features = ["map-foldhash"] } +alloy-primitives = { version = "1.4.1", default-features = false, features = [ + "map-foldhash", +] } alloy-consensus = { version = "1.0.41", features = ["kzg"] } alloy-rpc-types = "1.0.41" alloy-rpc-client = "1.0.41" @@ -250,4 +265,3 @@ ethereum_ssz_derive = "0.9.0" # base concurrent-queue = "2.5.0" -tips-core = { git = "https://github.com/base/tips", rev = "c08eaa4fe10c26de8911609b41ddab4918698325", default-features = false } diff --git a/crates/builder/op-rbuilder/Cargo.toml b/crates/builder/op-rbuilder/Cargo.toml index 517cb67f..065bd19d 100644 --- a/crates/builder/op-rbuilder/Cargo.toml +++ b/crates/builder/op-rbuilder/Cargo.toml @@ -18,8 +18,7 @@ unused_async = "warn" [dependencies] p2p = { path = "../p2p" } -tips-core.workspace = true - +base-bundles.workspace = true reth.workspace = true reth-optimism-node.workspace = true reth-optimism-cli.workspace = true @@ -161,7 +160,7 @@ vergen-git2.workspace = true [dev-dependencies] alloy-provider = { workspace = true, default-features = true, features = [ - "txpool-api", + "txpool-api", ] } tempfile = "3.8" macros = { path = "src/tests/framework/macros" } diff --git a/crates/builder/op-rbuilder/src/tests/backrun.rs b/crates/builder/op-rbuilder/src/tests/backrun.rs index 2883fec4..d5efcd87 100644 --- a/crates/builder/op-rbuilder/src/tests/backrun.rs +++ b/crates/builder/op-rbuilder/src/tests/backrun.rs @@ -3,7 +3,7 @@ use alloy_eips::eip2718::Encodable2718; use alloy_primitives::{TxHash, U256}; use alloy_provider::Provider; use macros::rb_test; -use tips_core::{AcceptedBundle, MeterBundleResponse}; +use base_bundles::{AcceptedBundle, MeterBundleResponse}; use uuid::Uuid; /// Tests that backrun bundles are all-or-nothing: diff --git a/crates/builder/op-rbuilder/src/tx_data_store.rs b/crates/builder/op-rbuilder/src/tx_data_store.rs index f6c6b6c0..affa1b8d 100644 --- a/crates/builder/op-rbuilder/src/tx_data_store.rs +++ b/crates/builder/op-rbuilder/src/tx_data_store.rs @@ -16,7 +16,7 @@ use std::{ }, time::Instant, }; -use tips_core::{AcceptedBundle, MeterBundleResponse}; +use base_bundles::{AcceptedBundle, MeterBundleResponse}; use tracing::{debug, info, warn}; use uuid::Uuid; diff --git a/crates/shared/bundles/src/accepted.rs b/crates/shared/bundles/src/accepted.rs index 1d5d80ae..cd0c2728 100644 --- a/crates/shared/bundles/src/accepted.rs +++ b/crates/shared/bundles/src/accepted.rs @@ -3,6 +3,7 @@ use alloy_consensus::transaction::Recovered; use alloy_primitives::TxHash; use op_alloy_consensus::OpTxEnvelope; +use serde::{Deserialize, Serialize}; use uuid::Uuid; use crate::{MeterBundleResponse, ParsedBundle}; @@ -10,7 +11,7 @@ use crate::{MeterBundleResponse, ParsedBundle}; /// `AcceptedBundle` is the type that is sent over the wire after validation. /// /// This represents a bundle that has been decoded, validated, and metered. -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Serialize, Deserialize)] pub struct AcceptedBundle { /// Unique identifier for this bundle instance. pub uuid: Uuid, @@ -19,27 +20,51 @@ pub struct AcceptedBundle { pub txs: Vec>, /// The target block number for inclusion. + #[serde(with = "alloy_serde::quantity")] pub block_number: u64, /// Minimum flashblock number for inclusion. + #[serde( + default, + deserialize_with = "alloy_serde::quantity::opt::deserialize", + skip_serializing_if = "Option::is_none" + )] pub flashblock_number_min: Option, /// Maximum flashblock number for inclusion. + #[serde( + default, + deserialize_with = "alloy_serde::quantity::opt::deserialize", + skip_serializing_if = "Option::is_none" + )] pub flashblock_number_max: Option, /// Minimum timestamp for inclusion. + #[serde( + default, + deserialize_with = "alloy_serde::quantity::opt::deserialize", + skip_serializing_if = "Option::is_none" + )] pub min_timestamp: Option, /// Maximum timestamp for inclusion. + #[serde( + default, + deserialize_with = "alloy_serde::quantity::opt::deserialize", + skip_serializing_if = "Option::is_none" + )] pub max_timestamp: Option, /// Transaction hashes that are allowed to revert. + #[serde(default, skip_serializing_if = "Vec::is_empty")] pub reverting_tx_hashes: Vec, /// UUID for bundle replacement (if this bundle replaces another). + #[serde(default, skip_serializing_if = "Option::is_none")] pub replacement_uuid: Option, /// Transaction hashes that should be dropped from the pool. + #[serde(default, skip_serializing_if = "Vec::is_empty")] pub dropping_tx_hashes: Vec, /// Metering response from bundle simulation.