Skip to content

Commit a338a9f

Browse files
authored
feat(flashtypes): Introduce Minimal Flashtypes Crate (#284)
* feat(flashtypes): minimal flashblocks type crate to remove rollup-boost dep * feat(flashtypes): minimal flashblocks type crate to remove rollup-boost dep * fixes * fix(ci): missing udeps check in just ci * fix(ci): lints 🐛
1 parent a0ab851 commit a338a9f

25 files changed

+394
-840
lines changed

Cargo.lock

Lines changed: 160 additions & 768 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,13 @@ base-reth-cli = { path = "crates/cli" }
5656
base-reth-rpc = { path = "crates/rpc" }
5757
base-tracex = { path = "crates/tracex" }
5858
base-reth-runner = { path = "crates/runner" }
59+
base-flashtypes = { path = "crates/flashtypes" }
5960
base-reth-test-utils = { path = "crates/test-utils" }
6061
base-reth-flashblocks = { path = "crates/flashblocks" }
6162

6263
# base/tips
6364
tips-core = { git = "https://github.com/base/tips", rev = "b1dfde6a5c8f603f19f9309ca6dc015bad260b44" }
6465

65-
# rollup-boost
66-
rollup-boost = { git = "http://github.com/flashbots/rollup-boost", rev = "v0.7.11" }
67-
6866
# reth
6967
reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }
7068
reth-ipc = { git = "https://github.com/paradigmxyz/reth", tag = "v1.9.3" }

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ lychee:
2121
@command -v lychee >/dev/null 2>&1 || cargo install lychee
2222
lychee --config ./lychee.toml .
2323

24-
# Checks formatting, clippy, and tests
25-
check: check-format check-clippy test
24+
# Checks formatting, udeps, clippy, and tests
25+
check: check-format check-udeps check-clippy test
2626

2727
# Fixes formatting and clippy issues
2828
fix: format-fix clippy-fix zepter-fix

crates/flashblocks/Cargo.toml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ repository.workspace = true
1212
workspace = true
1313

1414
[dependencies]
15+
# workspace
16+
base-flashtypes.workspace = true
17+
1518
# reth
1619
reth.workspace = true
1720
reth-evm.workspace = true
@@ -37,9 +40,6 @@ op-alloy-network.workspace = true
3740
op-alloy-rpc-types.workspace = true
3841
op-alloy-consensus.workspace = true
3942

40-
# rollup-boost
41-
rollup-boost.workspace = true
42-
4343
# tokio
4444
tokio.workspace = true
4545
tokio-tungstenite.workspace = true
@@ -50,19 +50,13 @@ futures-util.workspace = true
5050
# misc
5151
url.workspace = true
5252
eyre.workspace = true
53-
bytes.workspace = true
54-
serde.workspace = true
55-
brotli.workspace = true
5653
tracing.workspace = true
5754
metrics.workspace = true
5855
arc-swap.workspace = true
59-
serde_json.workspace = true
6056
metrics-derive.workspace = true
61-
derive_more = { workspace = true, features = ["display", "error"] }
6257

6358
[dev-dependencies]
6459
rand.workspace = true
65-
rstest.workspace = true
6660
reth-db.workspace = true
6761
once_cell.workspace = true
6862
reth-provider.workspace = true

crates/flashblocks/benches/pending_state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ use alloy_consensus::Receipt;
99
use alloy_eips::{BlockHashOrNumber, Encodable2718};
1010
use alloy_primitives::{Address, B256, BlockNumber, Bytes, U256, b256, bytes, hex::FromHex};
1111
use alloy_rpc_types_engine::PayloadId;
12-
use base_reth_flashblocks::{
13-
Flashblock, FlashblocksAPI, FlashblocksReceiver, FlashblocksState, Metadata,
12+
use base_flashtypes::{
13+
ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1, Flashblock, Metadata,
1414
};
15+
use base_reth_flashblocks::{FlashblocksAPI, FlashblocksReceiver, FlashblocksState};
1516
use base_reth_test_utils::{LocalNodeProvider, TestAccounts, TestHarness};
1617
use criterion::{BatchSize, Criterion, Throughput, criterion_group, criterion_main};
1718
use op_alloy_consensus::OpDepositReceipt;
@@ -22,7 +23,6 @@ use reth::{
2223
};
2324
use reth_optimism_primitives::{OpBlock, OpReceipt, OpTransactionSigned};
2425
use reth_primitives_traits::{Block as BlockT, RecoveredBlock};
25-
use rollup_boost::{ExecutionPayloadBaseV1, ExecutionPayloadFlashblockDeltaV1};
2626
use tokio::{runtime::Runtime, time::sleep};
2727
use tracing_subscriber::{EnvFilter, filter::LevelFilter};
2828

crates/flashblocks/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,3 @@ pub use subscription::FlashblocksSubscriber;
2020

2121
mod traits;
2222
pub use traits::{FlashblocksAPI, FlashblocksReceiver, PendingBlocksAPI};
23-
24-
mod blocks;
25-
pub use blocks::{Flashblock, FlashblockDecodeError, Metadata};

crates/flashblocks/src/pending_blocks.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ use alloy_provider::network::TransactionResponse;
1010
use alloy_rpc_types::{BlockTransactions, state::StateOverride};
1111
use alloy_rpc_types_eth::{Filter, Header as RPCHeader, Log};
1212
use arc_swap::Guard;
13+
use base_flashtypes::Flashblock;
1314
use eyre::eyre;
1415
use op_alloy_network::Optimism;
1516
use op_alloy_rpc_types::{OpTransactionReceipt, Transaction};
1617
use reth::revm::{db::Cache, state::EvmState};
1718
use reth_rpc_convert::RpcTransaction;
1819
use reth_rpc_eth_api::{RpcBlock, RpcReceipt};
1920

20-
use crate::{Flashblock, PendingBlocksAPI};
21+
use crate::PendingBlocksAPI;
2122

2223
/// Builder for [`PendingBlocks`].
2324
#[derive(Debug)]

crates/flashblocks/src/processor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use alloy_rpc_types::{TransactionTrait, Withdrawal};
1616
use alloy_rpc_types_engine::{ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3};
1717
use alloy_rpc_types_eth::state::StateOverride;
1818
use arc_swap::ArcSwapOption;
19+
use base_flashtypes::Flashblock;
1920
use eyre::eyre;
2021
use op_alloy_consensus::OpTxEnvelope;
2122
use op_alloy_network::TransactionResponse;
@@ -38,7 +39,7 @@ use reth_rpc_convert::transaction::ConvertReceiptInput;
3839
use tokio::sync::{Mutex, broadcast::Sender, mpsc::UnboundedReceiver};
3940
use tracing::{debug, error, info, warn};
4041

41-
use crate::{Flashblock, Metrics, PendingBlocks, PendingBlocksBuilder};
42+
use crate::{Metrics, PendingBlocks, PendingBlocksBuilder};
4243

4344
/// Messages consumed by the state processor.
4445
#[derive(Debug, Clone)]

crates/flashblocks/src/state.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::sync::Arc;
44

55
use alloy_consensus::Header;
66
use arc_swap::{ArcSwapOption, Guard};
7+
use base_flashtypes::Flashblock;
78
use reth::{
89
chainspec::{ChainSpecProvider, EthChainSpec},
910
providers::{BlockReaderIdExt, StateProviderFactory},
@@ -19,7 +20,7 @@ use tokio::sync::{
1920
use tracing::{error, info};
2021

2122
use crate::{
22-
Flashblock, FlashblocksAPI, FlashblocksReceiver, PendingBlocks,
23+
FlashblocksAPI, FlashblocksReceiver, PendingBlocks,
2324
processor::{StateProcessor, StateUpdate},
2425
};
2526

crates/flashblocks/src/subscription.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
33
use std::{sync::Arc, time::Duration};
44

5+
use base_flashtypes::Flashblock;
56
use futures_util::{SinkExt as _, StreamExt};
67
use tokio::{sync::mpsc, time::interval};
78
use tokio_tungstenite::{connect_async, tungstenite::protocol::Message};
89
use tracing::{error, info, trace, warn};
910
use url::Url;
1011

11-
use crate::{Flashblock, FlashblocksReceiver, Metrics};
12+
use crate::{FlashblocksReceiver, Metrics};
1213

1314
// Simplify actor messages to just handle shutdown
1415
#[derive(Debug)]

0 commit comments

Comments
 (0)