Skip to content

Flashblocks #98

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 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
10efd2d
Initial for fb
ferranbt Feb 7, 2025
e6fc052
Merge main
ferranbt Feb 9, 2025
e7673c1
Rebase main
ferranbt Feb 12, 2025
46f5f2d
Rebase again
ferranbt Feb 12, 2025
bb8736e
Merge main
ferranbt Feb 17, 2025
00e3622
Merge
ferranbt Feb 17, 2025
99958e1
Use separated crate
ferranbt Feb 17, 2025
44390ba
Some moves
ferranbt Feb 17, 2025
32ab828
Add diff
ferranbt Feb 18, 2025
245b75e
Add partial block building
ferranbt Feb 18, 2025
0074fed
Add lib
ferranbt Feb 18, 2025
6ada749
Rebased main
ferranbt Feb 18, 2025
397628c
Prov update alloy deps
ferranbt Feb 18, 2025
9c26323
Fix imports and make fb service public
ferranbt Feb 18, 2025
0b089a3
Add log
ferranbt Feb 18, 2025
e1d6068
Add better print statements
ferranbt Feb 19, 2025
ada938c
Add outbound server
ferranbt Feb 19, 2025
691a11e
add wss support (#106)
cody-wang-cb Feb 20, 2025
ef4a70c
Add debug statement
ferranbt Feb 27, 2025
6a2a5f7
Merge develop
ferranbt Feb 27, 2025
e74a1fd
Bump rustTls version
ferranbt Feb 27, 2025
9bfd6f3
deps: alloy 0.12.5 (#137)
efbig Mar 18, 2025
e287ac8
Rebase
ferranbt Mar 18, 2025
67f5974
Fix lint
ferranbt Mar 18, 2025
b4de9bf
Rebase main
ferranbt Apr 3, 2025
e20dbc5
Fix lint
ferranbt Apr 4, 2025
dac67b0
reth 1.3.11
cody-wang-cb Apr 16, 2025
e224906
reth 1.3.9 and metrics
cody-wang-cb Apr 16, 2025
6088534
Merge pull request #176 from cody-wang-cb/cody/reth-1.3.9
avalonche Apr 16, 2025
62723d7
metrics updates
jowparks Apr 16, 2025
616df18
Update metrics and error handling
jowparks Apr 17, 2025
2c867b0
add code commenting, remove unneeded error metric, PR comments
jowparks Apr 21, 2025
73e7f02
Merge pull request #178 from jowparks/metrics-updates
avalonche Apr 21, 2025
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
164 changes: 160 additions & 4 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ edition = "2024"
[dependencies]
op-alloy-rpc-types-engine = "0.12.0"
alloy-rpc-types-engine = "0.13.0"
alloy-rpc-types-eth = "0.13.0"
alloy-serde = "0.13.0"
alloy-eips = { version = "0.13.0", features = ["serde"], optional = true }
alloy-primitives = { version = "0.8.10", features = ["rand"] }
tokio = { version = "1", features = ["full"] }
Expand Down Expand Up @@ -39,6 +41,8 @@ tracing-opentelemetry = "0.29.0"
futures = "0.3.31"
metrics = "0.24.0"
metrics-exporter-prometheus = "0.16.0"
tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] }
url = "2.5"
metrics-util = "0.19.0"
eyre = "0.6.12"
paste = "1.0.15"
Expand All @@ -50,7 +54,6 @@ lazy_static = {version = "1.5.0", optional = true }

[dev-dependencies]
op-alloy-consensus = "0.12.0"
alloy-rpc-types-eth = "0.13.0"
anyhow = "1.0"
assert_cmd = "2.0.10"
predicates = "3.1.2"
Expand Down
14 changes: 12 additions & 2 deletions src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
use ::tracing::info;
use clap::Parser;
use rollup_boost::{
Args, Commands, DebugClient, DebugCommands, PayloadSource, ProxyLayer, RollupBoostServer,
RpcClient, init_metrics, init_tracing,
Args, Commands, DebugClient, DebugCommands, Flashblocks, PayloadSource, ProxyLayer,
RollupBoostServer, RpcClient, init_metrics, init_tracing,
};
use std::net::SocketAddr;

Expand Down Expand Up @@ -90,11 +90,21 @@ async fn main() -> eyre::Result<()> {
info!("Boost sync enabled");
}

let flashblocks_client = if args.flashblocks.flashblocks {
let inbound_url = args.flashblocks.flashblocks_url;
let outbound_url = args.flashblocks.flashblocks_outbound_url;

Some(Flashblocks::run(inbound_url, outbound_url).unwrap())
} else {
None
};

let rollup_boost = RollupBoostServer::new(
l2_client,
builder_client,
boost_sync_enabled,
args.execution_mode,
flashblocks_client,
);

// Spawn the debug server
Expand Down
19 changes: 19 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,25 @@ pub struct Args {
/// Execution mode to start rollup boost with
#[arg(long, env, default_value = "enabled")]
pub execution_mode: ExecutionMode,

/// Enable Flashblocks client
#[clap(flatten)]
pub flashblocks: FlashblocksArgs,
}

#[derive(Parser, Debug)]
pub struct FlashblocksArgs {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add docs to README and .env.example

/// Enable Flashblocks client
#[arg(long, env, default_value = "false")]
pub flashblocks: bool,

/// Flashblocks WebSocket URL
#[arg(long, env, default_value = "ws://localhost:1111")]
pub flashblocks_url: String,

/// Flashblocks outbound WebSocket URL
#[arg(long, env, default_value = "127.0.0.1:1112")]
pub flashblocks_outbound_url: String,
}

#[derive(Clone, Debug)]
Expand Down
Loading
Loading