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
66 changes: 43 additions & 23 deletions Cargo.lock

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

74 changes: 74 additions & 0 deletions crates/client/flashblocks-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@ license.workspace = true
homepage.workspace = true
repository.workspace = true

[features]
test-utils = [
"dep:base-flashtypes",
"dep:derive_more",
"dep:eyre",
"dep:reth-optimism-chainspec",
"reth-chain-state/test-utils",
"reth-chainspec/test-utils",
"reth-evm/test-utils",
"reth-provider/test-utils",
"reth-revm/test-utils",
]


[lints]
workspace = true

Expand All @@ -22,3 +36,63 @@ reth-chain-state.workspace = true
tokio-stream.workspace = true
tracing.workspace = true
tokio.workspace = true

# test-utils
derive_more = { workspace = true, features = ["deref"], optional = true }
eyre = { workspace = true, optional = true }
base-flashtypes = { workspace = true, optional = true }
reth-optimism-chainspec = { workspace = true, optional = true }


[dev-dependencies]
base-client-node = { workspace = true, features = ["test-utils"] }
base-flashblocks-node = { path = ".", features = ["test-utils"] }
rand.workspace = true
eyre.workspace = true
revm = { workspace = true, features = ["std"] }
reth-db.workspace = true
once_cell.workspace = true
reth-provider.workspace = true
reth-db-common.workspace = true
reth-primitives-traits.workspace = true
alloy-rpc-client.workspace = true
alloy-genesis.workspace = true
alloy-sol-macro = { workspace = true, features = ["json"] }
alloy-sol-types.workspace = true
alloy-contract.workspace = true
op-alloy-consensus.workspace = true
reth-tracing.workspace = true
reth-optimism-node.workspace = true
reth-testing-utils.workspace = true
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
tokio-tungstenite.workspace = true
tracing-subscriber.workspace = true
serde_json.workspace = true
futures-util.workspace = true
criterion = { version = "0.5", features = ["async_tokio"] }
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-provider.workspace = true
op-alloy-network.workspace = true
alloy-rpc-types-engine.workspace = true
rayon.workspace = true
reth-optimism-primitives.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-eth.workspace = true
op-alloy-rpc-types.workspace = true
reth-rpc-eth-api.workspace = true
reth-chainspec = { workspace = true }

reth-evm.workspace = true
reth-primitives.workspace = true
reth-revm.workspace = true


[[bench]]
name = "pending_state"
harness = false

[[bench]]
name = "sender_recovery"
harness = false
3 changes: 3 additions & 0 deletions crates/client/flashblocks-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
mod extension;
pub use base_flashblocks::FlashblocksConfig;
pub use extension::FlashblocksExtension;

#[cfg(any(test, feature = "test-utils"))]
pub mod test_harness;
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ use base_client_node::{
LocalNode, NODE_STARTUP_DELAY_MS, TestHarness, build_test_genesis, init_silenced_tracing,
},
};
use base_flashblocks::{
EthApiExt, EthApiOverrideServer, EthPubSub, EthPubSubApiServer, FlashblocksReceiver,
FlashblocksState,
};
use base_flashtypes::Flashblock;
use derive_more::Deref;
use eyre::Result;
Expand All @@ -26,11 +30,6 @@ use reth_optimism_chainspec::OpChainSpec;
use tokio::sync::{mpsc, oneshot};
use tokio_stream::{StreamExt, wrappers::BroadcastStream};

use crate::{
EthApiExt, EthApiOverrideServer, EthPubSub, EthPubSubApiServer, FlashblocksReceiver,
FlashblocksState,
};

/// Components that allow tests to interact with the Flashblocks worker tasks.
#[derive(Clone)]
pub struct FlashblocksParts {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use alloy_sol_types::SolCall;
use base_client_node::test_utils::{
Account, L1_BLOCK_INFO_DEPOSIT_TX, Minimal7702Account, SignerSync,
};
use base_flashblocks::test_harness::FlashblocksHarness;
use base_flashblocks_node::test_harness::FlashblocksHarness;
use base_flashtypes::{
ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1, Flashblock, Metadata,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use alloy_sol_types::{SolConstructor, SolValue};
use base_client_node::test_utils::{
Account, L1_BLOCK_INFO_DEPOSIT_TX, MockERC20, TransparentUpgradeableProxy,
};
use base_flashblocks::test_harness::FlashblocksHarness;
use base_flashblocks_node::test_harness::FlashblocksHarness;
use base_flashtypes::{
ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1, Flashblock, Metadata,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use alloy_rpc_types::simulate::{SimBlock, SimulatePayload};
use alloy_rpc_types_engine::PayloadId;
use alloy_rpc_types_eth::{TransactionInput, error::EthRpcErrorCode};
use base_client_node::test_utils::{Account, DoubleCounter, L1_BLOCK_INFO_DEPOSIT_TX};
use base_flashblocks::test_harness::FlashblocksHarness;
use base_flashblocks_node::test_harness::FlashblocksHarness;
use base_flashtypes::{
ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1, Flashblock, Metadata,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ use alloy_rpc_types_engine::PayloadId;
use base_client_node::test_utils::{
Account, L1_BLOCK_INFO_DEPOSIT_TX, L1_BLOCK_INFO_DEPOSIT_TX_HASH, LocalNodeProvider,
};
use base_flashblocks::{
FlashblocksAPI, FlashblocksState, PendingBlocksAPI, test_harness::FlashblocksHarness,
};
use base_flashblocks::{FlashblocksAPI, FlashblocksState, PendingBlocksAPI};
use base_flashblocks_node::test_harness::FlashblocksHarness;
use base_flashtypes::{
ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1, Flashblock, Metadata,
};
Expand Down
53 changes: 0 additions & 53 deletions crates/client/flashblocks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,11 @@ repository.workspace = true
[lints]
workspace = true

[features]
test-utils = [
"dep:base-client-node",
"dep:derive_more",
"dep:eyre",
"dep:reth-chain-state",
"reth-chain-state/test-utils",
"reth-chainspec/test-utils",
"reth-evm/test-utils",
"reth-primitives/test-utils",
"reth-provider/test-utils",
"reth-revm/test-utils",
]

[dependencies]
# workspace
base-flashtypes.workspace = true
base-client-node = { workspace = true, optional = true }

# reth
reth-chain-state = { workspace = true, optional = true }
reth-evm.workspace = true
reth-primitives.workspace = true
reth-rpc.workspace = true
Expand Down Expand Up @@ -88,42 +72,5 @@ arc-swap.workspace = true
metrics-derive.workspace = true
rayon.workspace = true

# Optional test-utils dependencies
derive_more = { workspace = true, features = ["deref"], optional = true }
eyre = { workspace = true, optional = true }

[dev-dependencies]
base-client-node = { workspace = true, features = ["test-utils"] }
base-flashblocks = { path = ".", features = ["test-utils"] }
rstest.workspace = true
rand.workspace = true
eyre.workspace = true
revm = { workspace = true, features = ["std"] }
reth-db.workspace = true
once_cell.workspace = true
reth-provider.workspace = true
reth-db-common.workspace = true
reth-primitives-traits.workspace = true
alloy-rpc-client.workspace = true
alloy-genesis.workspace = true
alloy-sol-macro = { workspace = true, features = ["json"] }
alloy-sol-types.workspace = true
alloy-contract.workspace = true
op-alloy-consensus.workspace = true
reth-tracing.workspace = true
reth-optimism-node.workspace = true
reth-testing-utils.workspace = true
reth-transaction-pool = { workspace = true, features = ["test-utils"] }
tokio-tungstenite.workspace = true
tracing-subscriber.workspace = true
serde_json.workspace = true
futures-util.workspace = true
criterion = { version = "0.5", features = ["async_tokio"] }

[[bench]]
name = "pending_state"
harness = false

[[bench]]
name = "sender_recovery"
harness = false
3 changes: 0 additions & 3 deletions crates/client/flashblocks/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,3 @@ pub use rpc::{
BaseSubscriptionKind, EthApiExt, EthApiOverrideServer, EthPubSub, EthPubSubApiServer,
ExtendedSubscriptionKind,
};

#[cfg(any(test, feature = "test-utils"))]
pub mod test_harness;
Loading