From b6a00143a87a7c548d6362fca496dd8e52f00477 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 19 May 2025 08:51:41 +0100 Subject: [PATCH 01/11] Add a workspace --- Cargo.lock | 269 +++++++++++++++++- Cargo.toml | 73 +---- crates/rollup-boost/Cargo.toml | 71 +++++ {src => crates/rollup-boost/src}/bin/main.rs | 0 {src => crates/rollup-boost/src}/cli.rs | 0 .../rollup-boost/src}/client/auth.rs | 0 .../rollup-boost/src}/client/http.rs | 0 .../rollup-boost/src}/client/mod.rs | 0 .../rollup-boost/src}/client/rpc.rs | 0 {src => crates/rollup-boost/src}/debug_api.rs | 0 {src => crates/rollup-boost/src}/health.rs | 0 .../integration_tests}/builder_full_delay.rs | 2 - .../builder_returns_incorrect_block.rs | 2 - .../src/integration_tests}/common/mod.rs | 0 .../src/integration_tests}/common/proxy.rs | 0 .../integration_tests}/common/services/mod.rs | 0 .../common/services/op_reth.rs | 0 .../common/services/rollup_boost.rs | 0 .../common/test_data/genesis.json | 0 .../common/test_data/jwt_secret.hex | 0 .../common/test_data/p2p_secret.hex | 0 .../src/integration_tests}/execution_mode.rs | 2 - .../rollup-boost/src/integration_tests/mod.rs | 3 + .../src/integration_tests}/no_tx_pool.rs | 0 .../integration_tests}/remote_builder_down.rs | 0 .../src/integration_tests}/simple.rs | 0 .../src/integration_tests}/simple_isthmus.rs | 0 .../simple_isthmus_transition.rs | 0 {src => crates/rollup-boost/src}/lib.rs | 2 + {src => crates/rollup-boost/src}/metrics.rs | 0 {src => crates/rollup-boost/src}/probe.rs | 0 {src => crates/rollup-boost/src}/proxy.rs | 0 {src => crates/rollup-boost/src}/server.rs | 0 {src => crates/rollup-boost/src}/tracing.rs | 0 .../websocket-proxy}/.dockerignore | 0 .../websocket-proxy}/.env.example | 0 .../websocket-proxy}/Cargo.lock | 0 .../websocket-proxy}/Cargo.toml | 0 .../websocket-proxy}/Dockerfile | 0 .../websocket-proxy}/README.md | 0 .../websocket-proxy}/src/client.rs | 0 .../websocket-proxy}/src/integration.rs | 0 .../websocket-proxy}/src/main.rs | 0 .../websocket-proxy}/src/metrics.rs | 0 .../websocket-proxy}/src/rate_limit.rs | 0 .../websocket-proxy}/src/registry.rs | 0 .../websocket-proxy}/src/server.rs | 0 .../websocket-proxy}/src/subscriber.rs | 0 48 files changed, 342 insertions(+), 82 deletions(-) create mode 100644 crates/rollup-boost/Cargo.toml rename {src => crates/rollup-boost/src}/bin/main.rs (100%) rename {src => crates/rollup-boost/src}/cli.rs (100%) rename {src => crates/rollup-boost/src}/client/auth.rs (100%) rename {src => crates/rollup-boost/src}/client/http.rs (100%) rename {src => crates/rollup-boost/src}/client/mod.rs (100%) rename {src => crates/rollup-boost/src}/client/rpc.rs (100%) rename {src => crates/rollup-boost/src}/debug_api.rs (100%) rename {src => crates/rollup-boost/src}/health.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/builder_full_delay.rs (99%) rename {tests => crates/rollup-boost/src/integration_tests}/builder_returns_incorrect_block.rs (99%) rename {tests => crates/rollup-boost/src/integration_tests}/common/mod.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/proxy.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/services/mod.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/services/op_reth.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/services/rollup_boost.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/test_data/genesis.json (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/test_data/jwt_secret.hex (100%) rename {tests => crates/rollup-boost/src/integration_tests}/common/test_data/p2p_secret.hex (100%) rename {tests => crates/rollup-boost/src/integration_tests}/execution_mode.rs (99%) create mode 100644 crates/rollup-boost/src/integration_tests/mod.rs rename {tests => crates/rollup-boost/src/integration_tests}/no_tx_pool.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/remote_builder_down.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/simple.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/simple_isthmus.rs (100%) rename {tests => crates/rollup-boost/src/integration_tests}/simple_isthmus_transition.rs (100%) rename {src => crates/rollup-boost/src}/lib.rs (94%) rename {src => crates/rollup-boost/src}/metrics.rs (100%) rename {src => crates/rollup-boost/src}/probe.rs (100%) rename {src => crates/rollup-boost/src}/proxy.rs (100%) rename {src => crates/rollup-boost/src}/server.rs (100%) rename {src => crates/rollup-boost/src}/tracing.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/.dockerignore (100%) rename {websocket-proxy => crates/websocket-proxy}/.env.example (100%) rename {websocket-proxy => crates/websocket-proxy}/Cargo.lock (100%) rename {websocket-proxy => crates/websocket-proxy}/Cargo.toml (100%) rename {websocket-proxy => crates/websocket-proxy}/Dockerfile (100%) rename {websocket-proxy => crates/websocket-proxy}/README.md (100%) rename {websocket-proxy => crates/websocket-proxy}/src/client.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/integration.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/main.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/metrics.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/rate_limit.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/registry.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/server.rs (100%) rename {websocket-proxy => crates/websocket-proxy}/src/subscriber.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 71bd99b7..9a177efa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -441,6 +441,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + [[package]] name = "ark-ff" version = "0.3.0" @@ -703,24 +709,61 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "itoa", + "matchit 0.7.3", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" +dependencies = [ + "axum-core 0.5.2", + "base64 0.22.1", "bytes", + "form_urlencoded", "futures-util", "http", "http-body", "http-body-util", + "hyper", + "hyper-util", "itoa", - "matchit", + "matchit 0.8.4", "memchr", "mime", "percent-encoding", "pin-project-lite", "rustversion", "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sha1", "sync_wrapper", + "tokio", + "tokio-tungstenite", "tower 0.5.2", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -743,6 +786,37 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "backoff" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" +dependencies = [ + "getrandom 0.2.15", + "instant", + "rand 0.8.5", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -1321,6 +1395,12 @@ dependencies = [ "syn 2.0.100", ] +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + [[package]] name = "der" version = "0.7.9" @@ -1465,6 +1545,12 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "dtor" version = "0.0.5" @@ -1705,6 +1791,34 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "flashblocks-websocket-proxy" +version = "0.1.0" +dependencies = [ + "axum 0.8.4", + "backoff", + "clap", + "dotenvy", + "futures", + "hostname", + "http", + "metrics", + "metrics-derive", + "metrics-exporter-prometheus 0.17.0", + "redis", + "redis-test", + "reqwest", + "ring", + "serde_json", + "thiserror 2.0.12", + "tokio", + "tokio-tungstenite", + "tokio-util", + "tracing", + "tracing-subscriber", + "uuid", +] + [[package]] name = "flate2" version = "1.1.1" @@ -2007,6 +2121,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "hostname" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" +dependencies = [ + "cfg-if", + "libc", + "windows-link", +] + [[package]] name = "http" version = "1.3.1" @@ -2395,6 +2520,15 @@ dependencies = [ "serde", ] +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + [[package]] name = "ipnet" version = "2.11.0" @@ -2782,6 +2916,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + [[package]] name = "memchr" version = "2.7.4" @@ -2798,6 +2938,18 @@ dependencies = [ "portable-atomic", ] +[[package]] +name = "metrics-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3dbdd96ed57d565ec744cba02862d707acf373c5772d152abae6ec5c4e24f6c" +dependencies = [ + "proc-macro2", + "quote", + "regex", + "syn 2.0.100", +] + [[package]] name = "metrics-exporter-prometheus" version = "0.16.2" @@ -2819,6 +2971,27 @@ dependencies = [ "tracing", ] +[[package]] +name = "metrics-exporter-prometheus" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df88858cd28baaaf2cfc894e37789ed4184be0e1351157aec7bf3c2266c793fd" +dependencies = [ + "base64 0.22.1", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "indexmap 2.8.0", + "ipnet", + "metrics", + "metrics-util", + "quanta", + "thiserror 2.0.12", + "tokio", + "tracing", +] + [[package]] name = "metrics-util" version = "0.19.0" @@ -3666,6 +3839,35 @@ dependencies = [ "bitflags 2.9.0", ] +[[package]] +name = "redis" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "438a4e5f8e9aa246d6f3666d6978441bf1b37d5f417b50c4dd220be09f5fcc17" +dependencies = [ + "arc-swap", + "combine", + "itoa", + "num-bigint", + "percent-encoding", + "ryu", + "sha1_smol", + "socket2", + "url", +] + +[[package]] +name = "redis-test" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "967d3ffa2d2ead5a95b2e8561d7453c4719c9fe9dbba521673e058e513cb1c24" +dependencies = [ + "rand 0.9.0", + "redis", + "socket2", + "tempfile", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -3845,7 +4047,7 @@ dependencies = [ "hyper-util", "jsonrpsee", "metrics", - "metrics-exporter-prometheus", + "metrics-exporter-prometheus 0.16.2", "metrics-util", "moka", "op-alloy-consensus", @@ -4227,6 +4429,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.20" @@ -4301,6 +4513,12 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + [[package]] name = "sha2" version = "0.10.8" @@ -4759,9 +4977,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.44.1" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" dependencies = [ "backtrace", "bytes", @@ -4833,6 +5051,20 @@ dependencies = [ "xattr", ] +[[package]] +name = "tokio-tungstenite" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" +dependencies = [ + "futures-util", + "log", + "native-tls", + "tokio", + "tokio-native-tls", + "tungstenite", +] + [[package]] name = "tokio-util" version = "0.7.14" @@ -4872,7 +5104,7 @@ checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.7.9", "base64 0.22.1", "bytes", "h2", @@ -4927,6 +5159,7 @@ dependencies = [ "tokio", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -5091,6 +5324,24 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" +dependencies = [ + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "native-tls", + "rand 0.9.0", + "sha1", + "thiserror 2.0.12", + "utf-8", +] + [[package]] name = "typenum" version = "1.18.0" @@ -5157,6 +5408,12 @@ dependencies = [ "serde", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf16_iter" version = "1.0.5" diff --git a/Cargo.toml b/Cargo.toml index aab060e5..0cce8d00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,71 +1,4 @@ -[package] -name = "rollup-boost" -version = "0.1.0" -edition = "2024" +[workspace] +resolver = "3" -[dependencies] -op-alloy-rpc-types-engine = "0.12.0" -alloy-rpc-types-engine = "0.13.0" -alloy-rpc-types-eth = "0.13.0" -alloy-primitives = { version = "0.8.10", features = ["rand"] } -tokio = { version = "1", features = ["full"] } -tracing = "0.1.4" -tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] } -serde = { version = "1", features = ["derive"] } -thiserror = "2.0.12" -clap = { version = "4", features = ["derive", "env"] } -jsonrpsee = { version = "0.24", features = ["server", "http-client", "macros"] } -moka = { version = "0.12.10", features = ["future"] } -http = "1.1.0" -dotenv = "0.15.0" -tower = "0.4.13" -tower-http = { version = "0.5.2", features = [ - "decompression-full", - "sensitive-headers", -] } -http-body-util = "0.1.2" -hyper = { version = "1.4.1", features = ["full"] } -hyper-util = { version = "0.1", features = ["full"] } -hyper-rustls = { version = "0.27.0", features = ["ring"] } -rustls = { version = "0.23.23", features = ["ring"] } -serde_json = "1.0.96" -opentelemetry = { version = "0.28.0", features = ["trace"] } -opentelemetry-otlp = { version = "0.28.0", features = [ - "http-proto", - "http-json", - "reqwest-client", - "trace", - "grpc-tonic", -] } -opentelemetry_sdk = { version = "0.28.0", features = ["rt-tokio"] } -tracing-opentelemetry = "0.29.0" -futures = "0.3.31" -metrics = "0.24.0" -metrics-exporter-prometheus = "0.16.0" -metrics-util = "0.19.0" -eyre = "0.6.12" -paste = "1.0.15" -parking_lot = "0.12.3" - -[dev-dependencies] -rand = "0.9.0" -time = { version = "0.3.36", features = ["macros", "formatting", "parsing"] } -op-alloy-consensus = "0.12.0" -alloy-eips = { version = "0.13.0", features = ["serde"] } -alloy-consensus = { version = "0.13.0", features = ["serde"] } -anyhow = "1.0" -testcontainers = { version = "0.23.3" } -assert_cmd = "2.0.10" -predicates = "3.1.2" -tokio-util = { version = "0.7.13" } -bytes = "1.2" -reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.7" } -ctor = "0.4.1" -reqwest = "0.12.15" - -[[bin]] -name = "rollup-boost" -path = "src/bin/main.rs" - -[lib] -path = "src/lib.rs" +members = ["crates/rollup-boost", "crates/websocket-proxy"] diff --git a/crates/rollup-boost/Cargo.toml b/crates/rollup-boost/Cargo.toml new file mode 100644 index 00000000..aab060e5 --- /dev/null +++ b/crates/rollup-boost/Cargo.toml @@ -0,0 +1,71 @@ +[package] +name = "rollup-boost" +version = "0.1.0" +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-primitives = { version = "0.8.10", features = ["rand"] } +tokio = { version = "1", features = ["full"] } +tracing = "0.1.4" +tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] } +serde = { version = "1", features = ["derive"] } +thiserror = "2.0.12" +clap = { version = "4", features = ["derive", "env"] } +jsonrpsee = { version = "0.24", features = ["server", "http-client", "macros"] } +moka = { version = "0.12.10", features = ["future"] } +http = "1.1.0" +dotenv = "0.15.0" +tower = "0.4.13" +tower-http = { version = "0.5.2", features = [ + "decompression-full", + "sensitive-headers", +] } +http-body-util = "0.1.2" +hyper = { version = "1.4.1", features = ["full"] } +hyper-util = { version = "0.1", features = ["full"] } +hyper-rustls = { version = "0.27.0", features = ["ring"] } +rustls = { version = "0.23.23", features = ["ring"] } +serde_json = "1.0.96" +opentelemetry = { version = "0.28.0", features = ["trace"] } +opentelemetry-otlp = { version = "0.28.0", features = [ + "http-proto", + "http-json", + "reqwest-client", + "trace", + "grpc-tonic", +] } +opentelemetry_sdk = { version = "0.28.0", features = ["rt-tokio"] } +tracing-opentelemetry = "0.29.0" +futures = "0.3.31" +metrics = "0.24.0" +metrics-exporter-prometheus = "0.16.0" +metrics-util = "0.19.0" +eyre = "0.6.12" +paste = "1.0.15" +parking_lot = "0.12.3" + +[dev-dependencies] +rand = "0.9.0" +time = { version = "0.3.36", features = ["macros", "formatting", "parsing"] } +op-alloy-consensus = "0.12.0" +alloy-eips = { version = "0.13.0", features = ["serde"] } +alloy-consensus = { version = "0.13.0", features = ["serde"] } +anyhow = "1.0" +testcontainers = { version = "0.23.3" } +assert_cmd = "2.0.10" +predicates = "3.1.2" +tokio-util = { version = "0.7.13" } +bytes = "1.2" +reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.7" } +ctor = "0.4.1" +reqwest = "0.12.15" + +[[bin]] +name = "rollup-boost" +path = "src/bin/main.rs" + +[lib] +path = "src/lib.rs" diff --git a/src/bin/main.rs b/crates/rollup-boost/src/bin/main.rs similarity index 100% rename from src/bin/main.rs rename to crates/rollup-boost/src/bin/main.rs diff --git a/src/cli.rs b/crates/rollup-boost/src/cli.rs similarity index 100% rename from src/cli.rs rename to crates/rollup-boost/src/cli.rs diff --git a/src/client/auth.rs b/crates/rollup-boost/src/client/auth.rs similarity index 100% rename from src/client/auth.rs rename to crates/rollup-boost/src/client/auth.rs diff --git a/src/client/http.rs b/crates/rollup-boost/src/client/http.rs similarity index 100% rename from src/client/http.rs rename to crates/rollup-boost/src/client/http.rs diff --git a/src/client/mod.rs b/crates/rollup-boost/src/client/mod.rs similarity index 100% rename from src/client/mod.rs rename to crates/rollup-boost/src/client/mod.rs diff --git a/src/client/rpc.rs b/crates/rollup-boost/src/client/rpc.rs similarity index 100% rename from src/client/rpc.rs rename to crates/rollup-boost/src/client/rpc.rs diff --git a/src/debug_api.rs b/crates/rollup-boost/src/debug_api.rs similarity index 100% rename from src/debug_api.rs rename to crates/rollup-boost/src/debug_api.rs diff --git a/src/health.rs b/crates/rollup-boost/src/health.rs similarity index 100% rename from src/health.rs rename to crates/rollup-boost/src/health.rs diff --git a/tests/builder_full_delay.rs b/crates/rollup-boost/src/integration_tests/builder_full_delay.rs similarity index 99% rename from tests/builder_full_delay.rs rename to crates/rollup-boost/src/integration_tests/builder_full_delay.rs index 79aa2c04..41fe7af1 100644 --- a/tests/builder_full_delay.rs +++ b/crates/rollup-boost/src/integration_tests/builder_full_delay.rs @@ -6,8 +6,6 @@ use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::time::Duration; -mod common; - // Create a dynamic handler that delays all the calls by 2 seconds struct DelayHandler { delay: Arc>, diff --git a/tests/builder_returns_incorrect_block.rs b/crates/rollup-boost/src/integration_tests/builder_returns_incorrect_block.rs similarity index 99% rename from tests/builder_returns_incorrect_block.rs rename to crates/rollup-boost/src/integration_tests/builder_returns_incorrect_block.rs index d1ad4746..a98c5478 100644 --- a/tests/builder_returns_incorrect_block.rs +++ b/crates/rollup-boost/src/integration_tests/builder_returns_incorrect_block.rs @@ -7,8 +7,6 @@ use serde_json::Value; use op_alloy_rpc_types_engine::OpExecutionPayloadEnvelopeV3; -mod common; - struct Handler; impl ProxyHandler for Handler { diff --git a/tests/common/mod.rs b/crates/rollup-boost/src/integration_tests/common/mod.rs similarity index 100% rename from tests/common/mod.rs rename to crates/rollup-boost/src/integration_tests/common/mod.rs diff --git a/tests/common/proxy.rs b/crates/rollup-boost/src/integration_tests/common/proxy.rs similarity index 100% rename from tests/common/proxy.rs rename to crates/rollup-boost/src/integration_tests/common/proxy.rs diff --git a/tests/common/services/mod.rs b/crates/rollup-boost/src/integration_tests/common/services/mod.rs similarity index 100% rename from tests/common/services/mod.rs rename to crates/rollup-boost/src/integration_tests/common/services/mod.rs diff --git a/tests/common/services/op_reth.rs b/crates/rollup-boost/src/integration_tests/common/services/op_reth.rs similarity index 100% rename from tests/common/services/op_reth.rs rename to crates/rollup-boost/src/integration_tests/common/services/op_reth.rs diff --git a/tests/common/services/rollup_boost.rs b/crates/rollup-boost/src/integration_tests/common/services/rollup_boost.rs similarity index 100% rename from tests/common/services/rollup_boost.rs rename to crates/rollup-boost/src/integration_tests/common/services/rollup_boost.rs diff --git a/tests/common/test_data/genesis.json b/crates/rollup-boost/src/integration_tests/common/test_data/genesis.json similarity index 100% rename from tests/common/test_data/genesis.json rename to crates/rollup-boost/src/integration_tests/common/test_data/genesis.json diff --git a/tests/common/test_data/jwt_secret.hex b/crates/rollup-boost/src/integration_tests/common/test_data/jwt_secret.hex similarity index 100% rename from tests/common/test_data/jwt_secret.hex rename to crates/rollup-boost/src/integration_tests/common/test_data/jwt_secret.hex diff --git a/tests/common/test_data/p2p_secret.hex b/crates/rollup-boost/src/integration_tests/common/test_data/p2p_secret.hex similarity index 100% rename from tests/common/test_data/p2p_secret.hex rename to crates/rollup-boost/src/integration_tests/common/test_data/p2p_secret.hex diff --git a/tests/execution_mode.rs b/crates/rollup-boost/src/integration_tests/execution_mode.rs similarity index 99% rename from tests/execution_mode.rs rename to crates/rollup-boost/src/integration_tests/execution_mode.rs index ead3884d..dfe81385 100644 --- a/tests/execution_mode.rs +++ b/crates/rollup-boost/src/integration_tests/execution_mode.rs @@ -6,8 +6,6 @@ use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::time::Duration; -mod common; - use crate::common::RollupBoostTestHarnessBuilder; struct CounterHandler { diff --git a/crates/rollup-boost/src/integration_tests/mod.rs b/crates/rollup-boost/src/integration_tests/mod.rs new file mode 100644 index 00000000..ce9b80ce --- /dev/null +++ b/crates/rollup-boost/src/integration_tests/mod.rs @@ -0,0 +1,3 @@ +mod builder_full_delay; +mod builder_returns_incorrect_block; +mod execution_mode; diff --git a/tests/no_tx_pool.rs b/crates/rollup-boost/src/integration_tests/no_tx_pool.rs similarity index 100% rename from tests/no_tx_pool.rs rename to crates/rollup-boost/src/integration_tests/no_tx_pool.rs diff --git a/tests/remote_builder_down.rs b/crates/rollup-boost/src/integration_tests/remote_builder_down.rs similarity index 100% rename from tests/remote_builder_down.rs rename to crates/rollup-boost/src/integration_tests/remote_builder_down.rs diff --git a/tests/simple.rs b/crates/rollup-boost/src/integration_tests/simple.rs similarity index 100% rename from tests/simple.rs rename to crates/rollup-boost/src/integration_tests/simple.rs diff --git a/tests/simple_isthmus.rs b/crates/rollup-boost/src/integration_tests/simple_isthmus.rs similarity index 100% rename from tests/simple_isthmus.rs rename to crates/rollup-boost/src/integration_tests/simple_isthmus.rs diff --git a/tests/simple_isthmus_transition.rs b/crates/rollup-boost/src/integration_tests/simple_isthmus_transition.rs similarity index 100% rename from tests/simple_isthmus_transition.rs rename to crates/rollup-boost/src/integration_tests/simple_isthmus_transition.rs diff --git a/src/lib.rs b/crates/rollup-boost/src/lib.rs similarity index 94% rename from src/lib.rs rename to crates/rollup-boost/src/lib.rs index 37e4ecfa..c29863c5 100644 --- a/src/lib.rs +++ b/crates/rollup-boost/src/lib.rs @@ -27,3 +27,5 @@ pub use probe::*; mod health; pub use health::*; + +mod integration_tests; diff --git a/src/metrics.rs b/crates/rollup-boost/src/metrics.rs similarity index 100% rename from src/metrics.rs rename to crates/rollup-boost/src/metrics.rs diff --git a/src/probe.rs b/crates/rollup-boost/src/probe.rs similarity index 100% rename from src/probe.rs rename to crates/rollup-boost/src/probe.rs diff --git a/src/proxy.rs b/crates/rollup-boost/src/proxy.rs similarity index 100% rename from src/proxy.rs rename to crates/rollup-boost/src/proxy.rs diff --git a/src/server.rs b/crates/rollup-boost/src/server.rs similarity index 100% rename from src/server.rs rename to crates/rollup-boost/src/server.rs diff --git a/src/tracing.rs b/crates/rollup-boost/src/tracing.rs similarity index 100% rename from src/tracing.rs rename to crates/rollup-boost/src/tracing.rs diff --git a/websocket-proxy/.dockerignore b/crates/websocket-proxy/.dockerignore similarity index 100% rename from websocket-proxy/.dockerignore rename to crates/websocket-proxy/.dockerignore diff --git a/websocket-proxy/.env.example b/crates/websocket-proxy/.env.example similarity index 100% rename from websocket-proxy/.env.example rename to crates/websocket-proxy/.env.example diff --git a/websocket-proxy/Cargo.lock b/crates/websocket-proxy/Cargo.lock similarity index 100% rename from websocket-proxy/Cargo.lock rename to crates/websocket-proxy/Cargo.lock diff --git a/websocket-proxy/Cargo.toml b/crates/websocket-proxy/Cargo.toml similarity index 100% rename from websocket-proxy/Cargo.toml rename to crates/websocket-proxy/Cargo.toml diff --git a/websocket-proxy/Dockerfile b/crates/websocket-proxy/Dockerfile similarity index 100% rename from websocket-proxy/Dockerfile rename to crates/websocket-proxy/Dockerfile diff --git a/websocket-proxy/README.md b/crates/websocket-proxy/README.md similarity index 100% rename from websocket-proxy/README.md rename to crates/websocket-proxy/README.md diff --git a/websocket-proxy/src/client.rs b/crates/websocket-proxy/src/client.rs similarity index 100% rename from websocket-proxy/src/client.rs rename to crates/websocket-proxy/src/client.rs diff --git a/websocket-proxy/src/integration.rs b/crates/websocket-proxy/src/integration.rs similarity index 100% rename from websocket-proxy/src/integration.rs rename to crates/websocket-proxy/src/integration.rs diff --git a/websocket-proxy/src/main.rs b/crates/websocket-proxy/src/main.rs similarity index 100% rename from websocket-proxy/src/main.rs rename to crates/websocket-proxy/src/main.rs diff --git a/websocket-proxy/src/metrics.rs b/crates/websocket-proxy/src/metrics.rs similarity index 100% rename from websocket-proxy/src/metrics.rs rename to crates/websocket-proxy/src/metrics.rs diff --git a/websocket-proxy/src/rate_limit.rs b/crates/websocket-proxy/src/rate_limit.rs similarity index 100% rename from websocket-proxy/src/rate_limit.rs rename to crates/websocket-proxy/src/rate_limit.rs diff --git a/websocket-proxy/src/registry.rs b/crates/websocket-proxy/src/registry.rs similarity index 100% rename from websocket-proxy/src/registry.rs rename to crates/websocket-proxy/src/registry.rs diff --git a/websocket-proxy/src/server.rs b/crates/websocket-proxy/src/server.rs similarity index 100% rename from websocket-proxy/src/server.rs rename to crates/websocket-proxy/src/server.rs diff --git a/websocket-proxy/src/subscriber.rs b/crates/websocket-proxy/src/subscriber.rs similarity index 100% rename from websocket-proxy/src/subscriber.rs rename to crates/websocket-proxy/src/subscriber.rs From c0282f54ff435a0a96dcd307f2e2a25009475079 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 19 May 2025 09:28:50 +0100 Subject: [PATCH 02/11] go --- crates/rollup-boost/src/cli.rs | 4 +--- crates/rollup-boost/src/integration_tests/mod.rs | 3 --- crates/rollup-boost/src/lib.rs | 3 ++- .../builder_full_delay.rs | 4 ++-- .../builder_returns_incorrect_block.rs | 2 +- .../src/{integration_tests => tests}/common/mod.rs | 12 +++++++----- .../src/{integration_tests => tests}/common/proxy.rs | 0 .../common/services/mod.rs | 0 .../common/services/op_reth.rs | 2 +- .../common/services/rollup_boost.rs | 4 ++-- .../common/test_data/genesis.json | 0 .../common/test_data/jwt_secret.hex | 0 .../common/test_data/p2p_secret.hex | 0 .../{integration_tests => tests}/execution_mode.rs | 7 +++---- crates/rollup-boost/src/tests/mod.rs | 10 ++++++++++ .../src/{integration_tests => tests}/no_tx_pool.rs | 4 +--- .../remote_builder_down.rs | 4 +--- .../src/{integration_tests => tests}/simple.rs | 4 +--- .../{integration_tests => tests}/simple_isthmus.rs | 4 +--- .../simple_isthmus_transition.rs | 4 +--- crates/rollup-boost/src/tracing.rs | 7 +++++++ 21 files changed, 41 insertions(+), 37 deletions(-) delete mode 100644 crates/rollup-boost/src/integration_tests/mod.rs rename crates/rollup-boost/src/{integration_tests => tests}/builder_full_delay.rs (95%) rename crates/rollup-boost/src/{integration_tests => tests}/builder_returns_incorrect_block.rs (96%) rename crates/rollup-boost/src/{integration_tests => tests}/common/mod.rs (98%) rename crates/rollup-boost/src/{integration_tests => tests}/common/proxy.rs (100%) rename crates/rollup-boost/src/{integration_tests => tests}/common/services/mod.rs (100%) rename crates/rollup-boost/src/{integration_tests => tests}/common/services/op_reth.rs (99%) rename crates/rollup-boost/src/{integration_tests => tests}/common/services/rollup_boost.rs (95%) rename crates/rollup-boost/src/{integration_tests => tests}/common/test_data/genesis.json (100%) rename crates/rollup-boost/src/{integration_tests => tests}/common/test_data/jwt_secret.hex (100%) rename crates/rollup-boost/src/{integration_tests => tests}/common/test_data/p2p_secret.hex (100%) rename crates/rollup-boost/src/{integration_tests => tests}/execution_mode.rs (96%) create mode 100644 crates/rollup-boost/src/tests/mod.rs rename crates/rollup-boost/src/{integration_tests => tests}/no_tx_pool.rs (93%) rename crates/rollup-boost/src/{integration_tests => tests}/remote_builder_down.rs (96%) rename crates/rollup-boost/src/{integration_tests => tests}/simple.rs (85%) rename crates/rollup-boost/src/{integration_tests => tests}/simple_isthmus.rs (86%) rename crates/rollup-boost/src/{integration_tests => tests}/simple_isthmus_transition.rs (86%) diff --git a/crates/rollup-boost/src/cli.rs b/crates/rollup-boost/src/cli.rs index ea2944c0..162d5114 100644 --- a/crates/rollup-boost/src/cli.rs +++ b/crates/rollup-boost/src/cli.rs @@ -90,9 +90,7 @@ pub struct Args { impl Args { pub async fn run(self) -> eyre::Result<()> { - rustls::crypto::ring::default_provider() - .install_default() - .expect("Failed to install TLS ring CryptoProvider"); + let _ = rustls::crypto::ring::default_provider().install_default(); let debug_addr = format!("{}:{}", self.debug_host, self.debug_server_port); diff --git a/crates/rollup-boost/src/integration_tests/mod.rs b/crates/rollup-boost/src/integration_tests/mod.rs deleted file mode 100644 index ce9b80ce..00000000 --- a/crates/rollup-boost/src/integration_tests/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod builder_full_delay; -mod builder_returns_incorrect_block; -mod execution_mode; diff --git a/crates/rollup-boost/src/lib.rs b/crates/rollup-boost/src/lib.rs index c29863c5..de343fa0 100644 --- a/crates/rollup-boost/src/lib.rs +++ b/crates/rollup-boost/src/lib.rs @@ -28,4 +28,5 @@ pub use probe::*; mod health; pub use health::*; -mod integration_tests; +#[cfg(test)] +pub mod tests; diff --git a/crates/rollup-boost/src/integration_tests/builder_full_delay.rs b/crates/rollup-boost/src/tests/builder_full_delay.rs similarity index 95% rename from crates/rollup-boost/src/integration_tests/builder_full_delay.rs rename to crates/rollup-boost/src/tests/builder_full_delay.rs index 41fe7af1..f7861fab 100644 --- a/crates/rollup-boost/src/integration_tests/builder_full_delay.rs +++ b/crates/rollup-boost/src/tests/builder_full_delay.rs @@ -1,5 +1,5 @@ -use common::RollupBoostTestHarnessBuilder; -use common::proxy::ProxyHandler; +use super::common::RollupBoostTestHarnessBuilder; +use super::common::proxy::ProxyHandler; use futures::FutureExt; use serde_json::Value; use std::pin::Pin; diff --git a/crates/rollup-boost/src/integration_tests/builder_returns_incorrect_block.rs b/crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs similarity index 96% rename from crates/rollup-boost/src/integration_tests/builder_returns_incorrect_block.rs rename to crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs index a98c5478..7deae951 100644 --- a/crates/rollup-boost/src/integration_tests/builder_returns_incorrect_block.rs +++ b/crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs @@ -1,7 +1,7 @@ use std::{pin::Pin, sync::Arc}; +use super::common::{RollupBoostTestHarnessBuilder, proxy::ProxyHandler}; use alloy_primitives::B256; -use common::{RollupBoostTestHarnessBuilder, proxy::ProxyHandler}; use futures::FutureExt as _; use serde_json::Value; diff --git a/crates/rollup-boost/src/integration_tests/common/mod.rs b/crates/rollup-boost/src/tests/common/mod.rs similarity index 98% rename from crates/rollup-boost/src/integration_tests/common/mod.rs rename to crates/rollup-boost/src/tests/common/mod.rs index 2dd08df7..8d93499d 100644 --- a/crates/rollup-boost/src/integration_tests/common/mod.rs +++ b/crates/rollup-boost/src/tests/common/mod.rs @@ -1,4 +1,8 @@ #![allow(dead_code)] +use crate::DebugClient; +use crate::{AuthLayer, AuthService}; +use crate::{EngineApiClient, OpExecutionPayloadEnvelope, Version}; +use crate::{NewPayload, PayloadSource}; use alloy_eips::Encodable2718; use alloy_primitives::{B256, Bytes, TxKind, U256, address, hex}; use alloy_rpc_types_engine::{ExecutionPayload, JwtSecret}; @@ -16,10 +20,6 @@ use op_alloy_consensus::TxDeposit; use op_alloy_rpc_types_engine::OpPayloadAttributes; use parking_lot::Mutex; use proxy::{ProxyHandler, start_proxy_server}; -use rollup_boost::DebugClient; -use rollup_boost::{AuthLayer, AuthService}; -use rollup_boost::{EngineApiClient, OpExecutionPayloadEnvelope, Version}; -use rollup_boost::{NewPayload, PayloadSource}; use serde_json::Value; use services::op_reth::{AUTH_RPC_PORT, OpRethConfig, OpRethImage, OpRethMehods, P2P_PORT}; use services::rollup_boost::{RollupBoost, RollupBoostConfig}; @@ -44,7 +44,7 @@ use tower_http::sensitive_headers::SetSensitiveRequestHeaders; pub const JWT_SECRET: &str = "688f5d737bad920bdfb2fc2f488d6b6209eebda1dae949a8de91398d932c517a"; pub const L2_P2P_ENODE: &str = "3479db4d9217fb5d7a8ed4d61ac36e120b05d36c2eefb795dc42ff2e971f251a2315f5649ea1833271e020b9adc98d5db9973c7ed92d6b2f1f2223088c3d852f"; pub static TEST_DATA: LazyLock = - LazyLock::new(|| format!("{}/tests/common/test_data", env!("CARGO_MANIFEST_DIR"))); + LazyLock::new(|| format!("{}/src/tests/common/test_data", env!("CARGO_MANIFEST_DIR"))); pub mod proxy; pub mod services; @@ -171,6 +171,8 @@ pub struct Genesis { impl Genesis { fn to_string(&self) -> eyre::Result { + println!("test data: {}", *TEST_DATA); + let file = File::open(PathBuf::from(format!("{}/genesis.json", *TEST_DATA))).unwrap(); let reader = BufReader::new(file); let mut genesis: Value = serde_json::from_reader(reader).unwrap(); diff --git a/crates/rollup-boost/src/integration_tests/common/proxy.rs b/crates/rollup-boost/src/tests/common/proxy.rs similarity index 100% rename from crates/rollup-boost/src/integration_tests/common/proxy.rs rename to crates/rollup-boost/src/tests/common/proxy.rs diff --git a/crates/rollup-boost/src/integration_tests/common/services/mod.rs b/crates/rollup-boost/src/tests/common/services/mod.rs similarity index 100% rename from crates/rollup-boost/src/integration_tests/common/services/mod.rs rename to crates/rollup-boost/src/tests/common/services/mod.rs diff --git a/crates/rollup-boost/src/integration_tests/common/services/op_reth.rs b/crates/rollup-boost/src/tests/common/services/op_reth.rs similarity index 99% rename from crates/rollup-boost/src/integration_tests/common/services/op_reth.rs rename to crates/rollup-boost/src/tests/common/services/op_reth.rs index 24f0d34f..9f9b51d1 100644 --- a/crates/rollup-boost/src/integration_tests/common/services/op_reth.rs +++ b/crates/rollup-boost/src/tests/common/services/op_reth.rs @@ -5,7 +5,7 @@ use testcontainers::{ core::{ContainerPort, WaitFor}, }; -use crate::common::TEST_DATA; +use crate::tests::common::TEST_DATA; const NAME: &str = "ghcr.io/paradigmxyz/op-reth"; const TAG: &str = "v1.3.12"; diff --git a/crates/rollup-boost/src/integration_tests/common/services/rollup_boost.rs b/crates/rollup-boost/src/tests/common/services/rollup_boost.rs similarity index 95% rename from crates/rollup-boost/src/integration_tests/common/services/rollup_boost.rs rename to crates/rollup-boost/src/tests/common/services/rollup_boost.rs index 4efd3f5c..8e99ad28 100644 --- a/crates/rollup-boost/src/integration_tests/common/services/rollup_boost.rs +++ b/crates/rollup-boost/src/tests/common/services/rollup_boost.rs @@ -1,10 +1,10 @@ use std::time::Duration; +use crate::Args; use clap::Parser; -use rollup_boost::Args; use tokio::task::JoinHandle; -use crate::common::{TEST_DATA, get_available_port}; +use crate::tests::common::{TEST_DATA, get_available_port}; #[derive(Debug)] pub struct RollupBoost { diff --git a/crates/rollup-boost/src/integration_tests/common/test_data/genesis.json b/crates/rollup-boost/src/tests/common/test_data/genesis.json similarity index 100% rename from crates/rollup-boost/src/integration_tests/common/test_data/genesis.json rename to crates/rollup-boost/src/tests/common/test_data/genesis.json diff --git a/crates/rollup-boost/src/integration_tests/common/test_data/jwt_secret.hex b/crates/rollup-boost/src/tests/common/test_data/jwt_secret.hex similarity index 100% rename from crates/rollup-boost/src/integration_tests/common/test_data/jwt_secret.hex rename to crates/rollup-boost/src/tests/common/test_data/jwt_secret.hex diff --git a/crates/rollup-boost/src/integration_tests/common/test_data/p2p_secret.hex b/crates/rollup-boost/src/tests/common/test_data/p2p_secret.hex similarity index 100% rename from crates/rollup-boost/src/integration_tests/common/test_data/p2p_secret.hex rename to crates/rollup-boost/src/tests/common/test_data/p2p_secret.hex diff --git a/crates/rollup-boost/src/integration_tests/execution_mode.rs b/crates/rollup-boost/src/tests/execution_mode.rs similarity index 96% rename from crates/rollup-boost/src/integration_tests/execution_mode.rs rename to crates/rollup-boost/src/tests/execution_mode.rs index dfe81385..433622f6 100644 --- a/crates/rollup-boost/src/integration_tests/execution_mode.rs +++ b/crates/rollup-boost/src/tests/execution_mode.rs @@ -1,13 +1,12 @@ -use common::proxy::ProxyHandler; +use super::common::RollupBoostTestHarnessBuilder; +use super::common::proxy::ProxyHandler; +use crate::ExecutionMode; use futures::FutureExt as _; -use rollup_boost::ExecutionMode; use serde_json::Value; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::time::Duration; -use crate::common::RollupBoostTestHarnessBuilder; - struct CounterHandler { counter: Arc>, } diff --git a/crates/rollup-boost/src/tests/mod.rs b/crates/rollup-boost/src/tests/mod.rs new file mode 100644 index 00000000..85cf23d5 --- /dev/null +++ b/crates/rollup-boost/src/tests/mod.rs @@ -0,0 +1,10 @@ +mod common; + +mod builder_full_delay; +mod builder_returns_incorrect_block; +mod execution_mode; +mod no_tx_pool; +mod remote_builder_down; +mod simple; +mod simple_isthmus; +mod simple_isthmus_transition; diff --git a/crates/rollup-boost/src/integration_tests/no_tx_pool.rs b/crates/rollup-boost/src/tests/no_tx_pool.rs similarity index 93% rename from crates/rollup-boost/src/integration_tests/no_tx_pool.rs rename to crates/rollup-boost/src/tests/no_tx_pool.rs index ac0e708c..af23a65c 100644 --- a/crates/rollup-boost/src/integration_tests/no_tx_pool.rs +++ b/crates/rollup-boost/src/tests/no_tx_pool.rs @@ -1,6 +1,4 @@ -mod common; - -use crate::common::RollupBoostTestHarnessBuilder; +use super::common::RollupBoostTestHarnessBuilder; #[tokio::test] async fn no_tx_pool() -> eyre::Result<()> { diff --git a/crates/rollup-boost/src/integration_tests/remote_builder_down.rs b/crates/rollup-boost/src/tests/remote_builder_down.rs similarity index 96% rename from crates/rollup-boost/src/integration_tests/remote_builder_down.rs rename to crates/rollup-boost/src/tests/remote_builder_down.rs index 041f69bb..475d979f 100644 --- a/crates/rollup-boost/src/integration_tests/remote_builder_down.rs +++ b/crates/rollup-boost/src/tests/remote_builder_down.rs @@ -1,10 +1,8 @@ -mod common; - use std::time::Duration; use testcontainers::core::client::docker_client_instance; -use crate::common::RollupBoostTestHarnessBuilder; +use super::common::RollupBoostTestHarnessBuilder; #[tokio::test] async fn remote_builder_down() -> eyre::Result<()> { diff --git a/crates/rollup-boost/src/integration_tests/simple.rs b/crates/rollup-boost/src/tests/simple.rs similarity index 85% rename from crates/rollup-boost/src/integration_tests/simple.rs rename to crates/rollup-boost/src/tests/simple.rs index 29b8c546..89d72070 100644 --- a/crates/rollup-boost/src/integration_tests/simple.rs +++ b/crates/rollup-boost/src/tests/simple.rs @@ -1,6 +1,4 @@ -use common::RollupBoostTestHarnessBuilder; - -mod common; +use super::common::RollupBoostTestHarnessBuilder; #[tokio::test] async fn test_integration_simple() -> eyre::Result<()> { diff --git a/crates/rollup-boost/src/integration_tests/simple_isthmus.rs b/crates/rollup-boost/src/tests/simple_isthmus.rs similarity index 86% rename from crates/rollup-boost/src/integration_tests/simple_isthmus.rs rename to crates/rollup-boost/src/tests/simple_isthmus.rs index 08c01a65..b7fef0ff 100644 --- a/crates/rollup-boost/src/integration_tests/simple_isthmus.rs +++ b/crates/rollup-boost/src/tests/simple_isthmus.rs @@ -1,6 +1,4 @@ -use common::RollupBoostTestHarnessBuilder; - -mod common; +use super::common::RollupBoostTestHarnessBuilder; #[tokio::test] async fn test_integration_simple_isthmus() -> eyre::Result<()> { diff --git a/crates/rollup-boost/src/integration_tests/simple_isthmus_transition.rs b/crates/rollup-boost/src/tests/simple_isthmus_transition.rs similarity index 86% rename from crates/rollup-boost/src/integration_tests/simple_isthmus_transition.rs rename to crates/rollup-boost/src/tests/simple_isthmus_transition.rs index 3ddfcc98..c429c048 100644 --- a/crates/rollup-boost/src/integration_tests/simple_isthmus_transition.rs +++ b/crates/rollup-boost/src/tests/simple_isthmus_transition.rs @@ -1,6 +1,4 @@ -use common::RollupBoostTestHarnessBuilder; - -mod common; +use super::common::RollupBoostTestHarnessBuilder; #[tokio::test] async fn test_integration_simple_isthmus_transition() -> eyre::Result<()> { diff --git a/crates/rollup-boost/src/tracing.rs b/crates/rollup-boost/src/tracing.rs index 2844d1e3..3ecf8191 100644 --- a/crates/rollup-boost/src/tracing.rs +++ b/crates/rollup-boost/src/tracing.rs @@ -5,6 +5,7 @@ use opentelemetry::{KeyValue, global}; use opentelemetry_otlp::WithExportConfig; use opentelemetry_sdk::trace::SpanProcessor; use opentelemetry_sdk::{Resource, propagation::TraceContextPropagator}; +use tracing::dispatcher::has_been_set; use tracing::level_filters::LevelFilter; use tracing_opentelemetry::OpenTelemetryLayer; use tracing_subscriber::Layer; @@ -71,6 +72,12 @@ impl SpanProcessor for MetricsSpanProcessor { } pub fn init_tracing(args: &Args) -> eyre::Result<()> { + if has_been_set() { + // This happens when running the integration tests + tracing::info!("Tracing already initialized"); + return Ok(()); + } + // Be cautious with snake_case and kebab-case here let filter_name = "rollup_boost".to_string(); From eed06b8e49d0ee16ab3c01773593e7e437b24e70 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 19 May 2025 11:41:00 +0100 Subject: [PATCH 03/11] Fix tests concurrency --- crates/rollup-boost/src/bin/main.rs | 6 +++++- crates/rollup-boost/src/cli.rs | 3 +-- crates/rollup-boost/src/tests/common/mod.rs | 2 +- .../src/tests/common/services/rollup_boost.rs | 21 ++++++++++++++++--- crates/rollup-boost/src/tracing.rs | 7 ------- 5 files changed, 25 insertions(+), 14 deletions(-) diff --git a/crates/rollup-boost/src/bin/main.rs b/crates/rollup-boost/src/bin/main.rs index 0208fb03..d33ca0c1 100644 --- a/crates/rollup-boost/src/bin/main.rs +++ b/crates/rollup-boost/src/bin/main.rs @@ -1,10 +1,14 @@ use clap::Parser; use rollup_boost::Args; +use rollup_boost::init_tracing; use dotenv::dotenv; #[tokio::main] async fn main() -> eyre::Result<()> { dotenv().ok(); - Args::parse().run().await + + let args = Args::parse(); + init_tracing(&args)?; + args.run().await } diff --git a/crates/rollup-boost/src/cli.rs b/crates/rollup-boost/src/cli.rs index 162d5114..c47c128e 100644 --- a/crates/rollup-boost/src/cli.rs +++ b/crates/rollup-boost/src/cli.rs @@ -11,7 +11,7 @@ use crate::{ DebugClient, PayloadSource, ProxyLayer, RollupBoostServer, RpcClient, client::rpc::{BuilderArgs, L2ClientArgs}, debug_api::ExecutionMode, - init_metrics, init_tracing, + init_metrics, probe::ProbeLayer, }; @@ -117,7 +117,6 @@ impl Args { }; } - init_tracing(&self)?; init_metrics(&self)?; let l2_client_args = self.l2_client; diff --git a/crates/rollup-boost/src/tests/common/mod.rs b/crates/rollup-boost/src/tests/common/mod.rs index 8d93499d..71e218f0 100644 --- a/crates/rollup-boost/src/tests/common/mod.rs +++ b/crates/rollup-boost/src/tests/common/mod.rs @@ -244,7 +244,7 @@ impl RollupBoostTestHarnessBuilder { let timestamp = dt.format(&format)?; let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")) - .join("integration_logs") + .join("../../integration_logs") .join(self.test_name.clone()) .join(timestamp); std::fs::create_dir_all(&dir)?; diff --git a/crates/rollup-boost/src/tests/common/services/rollup_boost.rs b/crates/rollup-boost/src/tests/common/services/rollup_boost.rs index 8e99ad28..0f59d175 100644 --- a/crates/rollup-boost/src/tests/common/services/rollup_boost.rs +++ b/crates/rollup-boost/src/tests/common/services/rollup_boost.rs @@ -1,8 +1,10 @@ -use std::time::Duration; +use std::{fs::File, time::Duration}; use crate::Args; use clap::Parser; use tokio::task::JoinHandle; +use tracing::subscriber::DefaultGuard; +use tracing_subscriber::fmt; use crate::tests::common::{TEST_DATA, get_available_port}; @@ -10,6 +12,7 @@ use crate::tests::common::{TEST_DATA, get_available_port}; pub struct RollupBoost { args: Args, pub _handle: JoinHandle>, + pub _tracing_guard: DefaultGuard, } impl RollupBoost { @@ -42,8 +45,6 @@ impl Default for RollupBoostConfig { &format!("--l2-jwt-path={}/jwt_secret.hex", *TEST_DATA), &format!("--builder-jwt-path={}/jwt_secret.hex", *TEST_DATA), "--log-level=trace", - "--tracing", - "--metrics", ]); args.rpc_port = get_available_port(); @@ -57,6 +58,19 @@ impl Default for RollupBoostConfig { impl RollupBoostConfig { pub async fn start(self) -> RollupBoost { let args = self.args.clone(); + + // Create a custom log subscriber only for this task + let log_file = args.log_file.as_ref().unwrap(); + let file = File::create(log_file).unwrap(); + + let subscriber = fmt::Subscriber::builder() + .with_writer(file) + .with_max_level(tracing::Level::DEBUG) + .with_ansi(false) + .finish(); + + let guard = tracing::subscriber::set_default(subscriber); + let _handle = tokio::spawn(async move { let res = args.clone().run().await; if let Err(e) = &res { @@ -71,6 +85,7 @@ impl RollupBoostConfig { RollupBoost { args: self.args, _handle, + _tracing_guard: guard, } } } diff --git a/crates/rollup-boost/src/tracing.rs b/crates/rollup-boost/src/tracing.rs index 3ecf8191..2844d1e3 100644 --- a/crates/rollup-boost/src/tracing.rs +++ b/crates/rollup-boost/src/tracing.rs @@ -5,7 +5,6 @@ use opentelemetry::{KeyValue, global}; use opentelemetry_otlp::WithExportConfig; use opentelemetry_sdk::trace::SpanProcessor; use opentelemetry_sdk::{Resource, propagation::TraceContextPropagator}; -use tracing::dispatcher::has_been_set; use tracing::level_filters::LevelFilter; use tracing_opentelemetry::OpenTelemetryLayer; use tracing_subscriber::Layer; @@ -72,12 +71,6 @@ impl SpanProcessor for MetricsSpanProcessor { } pub fn init_tracing(args: &Args) -> eyre::Result<()> { - if has_been_set() { - // This happens when running the integration tests - tracing::info!("Tracing already initialized"); - return Ok(()); - } - // Be cautious with snake_case and kebab-case here let filter_name = "rollup_boost".to_string(); From 19f021ac7492c036db7f92121784f079891803c5 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 19 May 2025 11:45:58 +0100 Subject: [PATCH 04/11] Update websocket proxy location --- .github/workflows/websocket-proxy-ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/websocket-proxy-ci.yaml b/.github/workflows/websocket-proxy-ci.yaml index 91c1f7d2..1fd4e5a9 100644 --- a/.github/workflows/websocket-proxy-ci.yaml +++ b/.github/workflows/websocket-proxy-ci.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest defaults: run: - working-directory: "./websocket-proxy" + working-directory: "./crates/websocket-proxy" steps: - name: Checkout code uses: actions/checkout@v4 From bb4e1b699f9014a8c5a2b45a7ca68b136ed4a127 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 19 May 2025 11:58:18 +0100 Subject: [PATCH 05/11] Fix --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a85aeee8..535803ae 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,5 +19,9 @@ jobs: toolchain: stable - name: Install cargo-nextest uses: taiki-e/install-action@nextest + + - name: Build the binary + run: cargo build + - name: Run nextest run: cargo nextest run From 0eb015bc58a1faafac7349ddb447905dad12dfa7 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Mon, 19 May 2025 12:01:18 +0100 Subject: [PATCH 06/11] Fix --- crates/rollup-boost/src/tests/common/mod.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/rollup-boost/src/tests/common/mod.rs b/crates/rollup-boost/src/tests/common/mod.rs index 71e218f0..c26d91ab 100644 --- a/crates/rollup-boost/src/tests/common/mod.rs +++ b/crates/rollup-boost/src/tests/common/mod.rs @@ -171,8 +171,6 @@ pub struct Genesis { impl Genesis { fn to_string(&self) -> eyre::Result { - println!("test data: {}", *TEST_DATA); - let file = File::open(PathBuf::from(format!("{}/genesis.json", *TEST_DATA))).unwrap(); let reader = BufReader::new(file); let mut genesis: Value = serde_json::from_reader(reader).unwrap(); From 56cceef3b7fd72c155508c636a8773fedb467ffc Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Tue, 20 May 2025 08:40:10 +0100 Subject: [PATCH 07/11] Update cargo run commands --- README.md | 4 ++-- RELEASE.md | 2 +- docs/running-rollup-boost.md | 13 +++++-------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 6791ba34..3ee35c85 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Rollup Boost is a block builder sidecar for Optimism Stack chains to enable exte Run the rollup-boost server using the following command: ``` -cargo run -- [OPTIONS] +cargo run --bin rollup-boost -- [OPTIONS] ``` ### Command-line Options @@ -34,7 +34,7 @@ You can also set the options using environment variables. See .env.example to us ### Example ``` -cargo run --l2-jwt-token your_jwt_token --l2-url http://localhost:8545 --builder-jwt-token your_jwt_token --builder-url http://localhost:8546 +cargo run --bin rollup-boost -- --l2-jwt-token your_jwt_token --l2-url http://localhost:8545 --builder-jwt-token your_jwt_token --builder-url http://localhost:8546 ``` ## Core System Workflow diff --git a/RELEASE.md b/RELEASE.md index 206b1d03..a93056bc 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -21,7 +21,7 @@ make test git status # should show no changes # Start rollup-boost with the example .env config -cargo run -- +cargo run --bin rollup-boost -- # Call the health endpoint curl localhost:8081/healthz diff --git a/docs/running-rollup-boost.md b/docs/running-rollup-boost.md index 4b9c8663..5d3ab65a 100644 --- a/docs/running-rollup-boost.md +++ b/docs/running-rollup-boost.md @@ -11,7 +11,7 @@ To run rollup boost with a regular sequencer setup, change the `--l2` flag in th To configure rollup-boost, set the l2 url to the url of the proposer auth rpc endpoint and the builder url to the builder auth rpc endpoint. ```bash -cargo run -- --l2-url http://localhost:8551 --builder-url http://localhost:8546 +cargo run --bin rollup-boost -- --l2-url http://localhost:8551 --builder-url http://localhost:8546 ``` To set up a builder, you can use [`op-rbuilder`](https://github.com/flashbots/op-rbuilder) with an op-node instance and have rollup-boost point to the builder auth rpc endpoint. It is recommended that boost sync is enabled on rollup-boost to sync the builder with the proposer op-node to remove the p2p networking overhead. In testing, this reduces latency significantly from around 200-300 milliseconds to just 3-4 milliseconds in local environments. @@ -32,11 +32,8 @@ While this does not ensure high availability for the builder, the chain will hav `rollup-boost` supports the standard array of kubernetes probes: -- `/healthz` Returns various status codes to communicate `rollup-boost` health - - 200 OK - The builder is producing blocks - - 206 Partial Content - The l2 is producing blocks, but the builder is not - - 503 Service Unavailable - Neither the l2 or the builder is producing blocks -`op-conductor` should eventually be able to use this signal to switch to a different sequencer in an HA sequencer setup. In a future upgrade to `op-conductor`, A sequencer leader with a healthy (200 OK) EL (`rollup-boost` in our case) could be selected preferentially over one with an unhealthy (206 or 503) EL. If no ELs are healthy, then we can fallback to an EL which is responding with `206 Partial Content`. +- `/healthz` Returns various status codes to communicate `rollup-boost` health - 200 OK - The builder is producing blocks - 206 Partial Content - The l2 is producing blocks, but the builder is not - 503 Service Unavailable - Neither the l2 or the builder is producing blocks + `op-conductor` should eventually be able to use this signal to switch to a different sequencer in an HA sequencer setup. In a future upgrade to `op-conductor`, A sequencer leader with a healthy (200 OK) EL (`rollup-boost` in our case) could be selected preferentially over one with an unhealthy (206 or 503) EL. If no ELs are healthy, then we can fallback to an EL which is responding with `206 Partial Content`. - `/readyz` Used by kubernetes to determine if the service is ready to accept traffic. Should always respond with `200 OK` @@ -58,7 +55,7 @@ To enable metrics, you can set the `--metrics` flag. This will start a metrics s curl http://localhost:9090/metrics ``` -All spans create duration histogram metrics with the name "{span_name}_duration". Currently, this list includes: +All spans create duration histogram metrics with the name "{span_name}\_duration". Currently, this list includes: - fork_choice_updated_v3_duration - get_payload_v3_duration @@ -84,4 +81,4 @@ It is also possible that either the builder or the proposer execution engine are Alternatively, the builder may be syncing with the chain and not have a block to respond with. You can see in the logs the builder is syncing by checking whether the payload_status of builder calls is `SYNCING`. -This is expected if the builder is still syncing with the chain. Chain liveness will not be affected as rollup-boost will use the local payload. Contact the builder operator if the sync status persists as the builder op-node may be offline or not peered correctly with the network. +This is expected if the builder is still syncing with the chain. Chain liveness will not be affected as rollup-boost will use the local payload. Contact the builder operator if the sync status persists as the builder op-node may be offline or not peered correctly with the network. From eda9fd92f229be7313807980207ace46ec80f253 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Tue, 20 May 2025 08:52:58 +0100 Subject: [PATCH 08/11] Use workspace dependencies --- Cargo.toml | 10 ++++++++++ crates/rollup-boost/Cargo.toml | 17 +++++++++-------- crates/websocket-proxy/Cargo.toml | 20 ++++++++++---------- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0cce8d00..1e9af461 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,3 +2,13 @@ resolver = "3" members = ["crates/rollup-boost", "crates/websocket-proxy"] + +[workspace.dependencies] +tracing = "0.1.4" +tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] } +clap = { version = "4", features = ["derive", "env"] } +futures = "0.3.31" +thiserror = "2.0.11" +serde_json = "1.0.96" +metrics = "0.24.0" +tokio = { version = "1", features = ["full"] } diff --git a/crates/rollup-boost/Cargo.toml b/crates/rollup-boost/Cargo.toml index aab060e5..cdd37ddc 100644 --- a/crates/rollup-boost/Cargo.toml +++ b/crates/rollup-boost/Cargo.toml @@ -4,16 +4,20 @@ version = "0.1.0" edition = "2024" [dependencies] +tracing.workspace = true +tracing-subscriber.workspace = true +clap.workspace = true +futures.workspace = true +thiserror.workspace = true +serde_json.workspace = true +metrics.workspace = true +tokio.workspace = true + op-alloy-rpc-types-engine = "0.12.0" alloy-rpc-types-engine = "0.13.0" alloy-rpc-types-eth = "0.13.0" alloy-primitives = { version = "0.8.10", features = ["rand"] } -tokio = { version = "1", features = ["full"] } -tracing = "0.1.4" -tracing-subscriber = { version = "0.3.11", features = ["env-filter", "json"] } serde = { version = "1", features = ["derive"] } -thiserror = "2.0.12" -clap = { version = "4", features = ["derive", "env"] } jsonrpsee = { version = "0.24", features = ["server", "http-client", "macros"] } moka = { version = "0.12.10", features = ["future"] } http = "1.1.0" @@ -28,7 +32,6 @@ hyper = { version = "1.4.1", features = ["full"] } hyper-util = { version = "0.1", features = ["full"] } hyper-rustls = { version = "0.27.0", features = ["ring"] } rustls = { version = "0.23.23", features = ["ring"] } -serde_json = "1.0.96" opentelemetry = { version = "0.28.0", features = ["trace"] } opentelemetry-otlp = { version = "0.28.0", features = [ "http-proto", @@ -39,8 +42,6 @@ opentelemetry-otlp = { version = "0.28.0", features = [ ] } opentelemetry_sdk = { version = "0.28.0", features = ["rt-tokio"] } tracing-opentelemetry = "0.29.0" -futures = "0.3.31" -metrics = "0.24.0" metrics-exporter-prometheus = "0.16.0" metrics-util = "0.19.0" eyre = "0.6.12" diff --git a/crates/websocket-proxy/Cargo.toml b/crates/websocket-proxy/Cargo.toml index 180dbdd7..425bd9c0 100644 --- a/crates/websocket-proxy/Cargo.toml +++ b/crates/websocket-proxy/Cargo.toml @@ -5,28 +5,28 @@ edition = "2021" rust-version = "1.85" [dependencies] -tokio = { version = "1.44.2", features = ["full"] } +tracing.workspace = true +tracing-subscriber.workspace = true +clap.workspace = true +futures.workspace = true +thiserror.workspace = true +serde_json.workspace = true +metrics.workspace = true +tokio.workspace = true + tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] } metrics-exporter-prometheus = { version = "0.17.0", features = ["http-listener"]} http = "1.2.0" axum = { version = "0.8.1", features = ["ws"] } -tracing = "0.1.41" -clap = { version = "4", features = ["derive", "env"] } dotenvy = "0.15.7" backoff = "0.4.0" -futures = "0.3.31" -tracing-subscriber = { version = "0.3.19", features = ["json", "env-filter"] } -tokio-util = "0.7.12" reqwest = { version = "0.12.15", default-features = false, features = ["native-tls"] } -metrics = "0.24.1" metrics-derive = "0.1" -thiserror = "2.0.11" -serde_json = "1.0.138" hostname = "0.4.0" redis = "0.30.0" redis-test = { version = "0.10.0", optional = true } uuid = { version = "1.16.0", features = ["v4"] } - +tokio-util = "0.7.12" [dependencies.ring] version = "0.17.12" From a049592db471b35f26e510c0c1fde479d10846e3 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 28 May 2025 21:31:49 +0200 Subject: [PATCH 09/11] Fix issues --- crates/rollup-boost/src/tests/builder_full_delay.rs | 4 +--- .../src/tests/builder_returns_incorrect_block.rs | 3 +-- crates/rollup-boost/src/tests/common/mod.rs | 7 +------ crates/rollup-boost/src/tests/execution_mode.rs | 4 +--- crates/rollup-boost/src/tests/fcu_no_block_time_delay.rs | 6 +----- 5 files changed, 5 insertions(+), 19 deletions(-) diff --git a/crates/rollup-boost/src/tests/builder_full_delay.rs b/crates/rollup-boost/src/tests/builder_full_delay.rs index 9fab2e87..56768f27 100644 --- a/crates/rollup-boost/src/tests/builder_full_delay.rs +++ b/crates/rollup-boost/src/tests/builder_full_delay.rs @@ -1,7 +1,5 @@ use super::common::RollupBoostTestHarnessBuilder; -use super::common::proxy::ProxyHandler; -use common::RollupBoostTestHarnessBuilder; -use common::proxy::BuilderProxyHandler; +use super::common::proxy::BuilderProxyHandler; use futures::FutureExt; use serde_json::Value; use std::pin::Pin; diff --git a/crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs b/crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs index b6479dce..3f5f84cc 100644 --- a/crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs +++ b/crates/rollup-boost/src/tests/builder_returns_incorrect_block.rs @@ -1,8 +1,7 @@ use std::{pin::Pin, sync::Arc}; -use super::common::{RollupBoostTestHarnessBuilder, proxy::ProxyHandler}; +use super::common::{RollupBoostTestHarnessBuilder, proxy::BuilderProxyHandler}; use alloy_primitives::B256; -use common::{RollupBoostTestHarnessBuilder, proxy::BuilderProxyHandler}; use futures::FutureExt as _; use serde_json::Value; diff --git a/crates/rollup-boost/src/tests/common/mod.rs b/crates/rollup-boost/src/tests/common/mod.rs index 83864f6a..f2ce97a2 100644 --- a/crates/rollup-boost/src/tests/common/mod.rs +++ b/crates/rollup-boost/src/tests/common/mod.rs @@ -1,7 +1,7 @@ #![allow(dead_code)] use crate::DebugClient; use crate::{AuthLayer, AuthService}; -use crate::{EngineApiClient, OpExecutionPayloadEnvelope, Version}; +use crate::{EngineApiClient, OpExecutionPayloadEnvelope, PayloadVersion}; use crate::{NewPayload, PayloadSource}; use alloy_eips::Encodable2718; use alloy_primitives::{B256, Bytes, TxKind, U256, address, hex}; @@ -20,12 +20,7 @@ use jsonrpsee::proc_macros::rpc; use op_alloy_consensus::TxDeposit; use op_alloy_rpc_types_engine::OpPayloadAttributes; use parking_lot::Mutex; -use proxy::{ProxyHandler, start_proxy_server}; use proxy::{BuilderProxyHandler, start_proxy_server}; -use rollup_boost::DebugClient; -use rollup_boost::EngineApiClient; -use rollup_boost::{AuthLayer, AuthService}; -use rollup_boost::{NewPayload, OpExecutionPayloadEnvelope, PayloadSource, PayloadVersion}; use serde_json::Value; use services::op_reth::{AUTH_RPC_PORT, OpRethConfig, OpRethImage, OpRethMehods, P2P_PORT}; use services::rollup_boost::{RollupBoost, RollupBoostConfig}; diff --git a/crates/rollup-boost/src/tests/execution_mode.rs b/crates/rollup-boost/src/tests/execution_mode.rs index 892b650e..8aa17ed4 100644 --- a/crates/rollup-boost/src/tests/execution_mode.rs +++ b/crates/rollup-boost/src/tests/execution_mode.rs @@ -1,7 +1,5 @@ -use super::common::RollupBoostTestHarnessBuilder; -use super::common::proxy::ProxyHandler; +use super::common::{RollupBoostTestHarnessBuilder, proxy::BuilderProxyHandler}; use crate::ExecutionMode; -use common::proxy::BuilderProxyHandler; use futures::FutureExt as _; use serde_json::Value; use std::pin::Pin; diff --git a/crates/rollup-boost/src/tests/fcu_no_block_time_delay.rs b/crates/rollup-boost/src/tests/fcu_no_block_time_delay.rs index 68748913..1fb316f6 100644 --- a/crates/rollup-boost/src/tests/fcu_no_block_time_delay.rs +++ b/crates/rollup-boost/src/tests/fcu_no_block_time_delay.rs @@ -1,9 +1,5 @@ -use super::common::RollupBoostTestHarnessBuilder; -use super::common::proxy::ProxyHandler; -mod common; +use super::common::{RollupBoostTestHarnessBuilder, proxy::BuilderProxyHandler}; -use common::RollupBoostTestHarnessBuilder; -use common::proxy::BuilderProxyHandler; use futures::FutureExt; use serde_json::Value; use std::pin::Pin; From 7f26639e1226006eeec0b3fc8e8b1e21703a3ec2 Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 28 May 2025 21:51:33 +0200 Subject: [PATCH 10/11] update deny --- deny.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deny.toml b/deny.toml index 6efaacda..2cb4a66a 100644 --- a/deny.toml +++ b/deny.toml @@ -17,6 +17,10 @@ confidence-threshold = 0.8 ignore = [ # paste crate is unmaintained "RUSTSEC-2024-0436", + # backoff crate is unmaintained + "RUSTSEC-2025-0012", + # instant crate is unmaintained + "RUSTSEC-2024-0384", ] [bans] From e8a9c44d8dcd4f202e3e255096456a244a7cb0dd Mon Sep 17 00:00:00 2001 From: Ferran Borreguero Date: Wed, 28 May 2025 21:56:51 +0200 Subject: [PATCH 11/11] More deny stuff --- crates/rollup-boost/Cargo.toml | 1 + crates/websocket-proxy/Cargo.toml | 9 +++++++-- deny.toml | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/crates/rollup-boost/Cargo.toml b/crates/rollup-boost/Cargo.toml index 3bc3aaa2..a47d68d2 100644 --- a/crates/rollup-boost/Cargo.toml +++ b/crates/rollup-boost/Cargo.toml @@ -2,6 +2,7 @@ name = "rollup-boost" version = "0.1.0" edition = "2024" +license = "MIT" [dependencies] tracing.workspace = true diff --git a/crates/websocket-proxy/Cargo.toml b/crates/websocket-proxy/Cargo.toml index 425bd9c0..c14b80f0 100644 --- a/crates/websocket-proxy/Cargo.toml +++ b/crates/websocket-proxy/Cargo.toml @@ -3,6 +3,7 @@ name = "flashblocks-websocket-proxy" version = "0.1.0" edition = "2021" rust-version = "1.85" +license = "MIT" [dependencies] tracing.workspace = true @@ -15,12 +16,16 @@ metrics.workspace = true tokio.workspace = true tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] } -metrics-exporter-prometheus = { version = "0.17.0", features = ["http-listener"]} +metrics-exporter-prometheus = { version = "0.17.0", features = [ + "http-listener", +] } http = "1.2.0" axum = { version = "0.8.1", features = ["ws"] } dotenvy = "0.15.7" backoff = "0.4.0" -reqwest = { version = "0.12.15", default-features = false, features = ["native-tls"] } +reqwest = { version = "0.12.15", default-features = false, features = [ + "native-tls", +] } metrics-derive = "0.1" hostname = "0.4.0" redis = "0.30.0" diff --git a/deny.toml b/deny.toml index 2cb4a66a..67b0766b 100644 --- a/deny.toml +++ b/deny.toml @@ -10,6 +10,7 @@ allow = [ "BSD-3-Clause", "Zlib", "OpenSSL", + "CDLA-Permissive-2.0", ] confidence-threshold = 0.8