-
Notifications
You must be signed in to change notification settings - Fork 67
Add Support for Library Mode #420
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
💡 Enable Vercel Agent with $100 free credit for automated AI reviews |
983e29b
to
a5b5b85
Compare
crates/rollup-boost/src/metrics.rs
Outdated
@@ -1,22 +1,38 @@ | |||
#[cfg(all(feature = "server", feature = "metrics-exporter-prometheus"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you gating the whole file behind the server feature? if so declaring this once at the top should work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was yes, but I am now proposing that we not to introduce a new feature to differentiate between server and library components. Instead, I'd like to propose they both are exposed by the same crate and feature. Is this OK?
} | ||
} | ||
|
||
#[cfg(feature = "server")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to feature gate tests?
I expect that all tests would be run with default features (which should include server)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Removing all feature gating that I had introduced before.
TBH i feel that we need more in-depth split of binary-library |
a5b5b85
to
a26d554
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements library mode functionality for rollup-boost, enabling direct integration into Rust applications while maintaining backward compatibility with existing server deployments. The changes introduce a structured configuration system and feature flag support to allow both server and library usage patterns.
- Adds
RollupBoost
struct with builder pattern configuration for library use - Refactors client configuration through centralized
ClientArgs
struct - Implements feature flag system separating server and library functionality
Reviewed Changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
crates/websocket-proxy/Cargo.toml | Adds integration feature flag |
crates/rollup-boost/src/server.rs | Refactors server to use trait objects and adds factory method |
crates/rollup-boost/src/proxy.rs | Simplifies proxy layer to accept pre-built HTTP clients |
crates/rollup-boost/src/flashblocks/args.rs | Adds Default implementation for FlashblocksArgs |
crates/rollup-boost/src/client/rpc.rs | Introduces ClientArgs struct with factory methods |
crates/rollup-boost/src/cli.rs | Refactors CLI to use new ClientArgs pattern |
crates/rollup-boost/Cargo.toml | Updates reth-rpc-layer dependency version |
Cargo.toml | Updates reth-optimism-payload-builder dependency version |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
a26d554
to
94b7ccb
Compare
* unify client configuration with ClientArgs struct * Consolidate BuilderArgs/L2ClientArgs into unified ClientArgs pattern * Move JWT handling into ClientArgs with helper methods * Update ProxyLayer to accept HttpClient instances instead of raw config * Add RollupBoostServer::new_from_args for cleaner initialization * Bump reth-rpc-layer to v1.8.2
94b7ccb
to
e9ee917
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 9 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
// health_check_interval: 60, | ||
// max_unsafe_interval: 10, | ||
// rpc_host: "127.0.0.1".to_string(), | ||
// rpc_port: 8081, | ||
// tracing: false, | ||
// metrics: false, | ||
// metrics_host: "127.0.0.1".to_string(), | ||
// metrics_port: 9090, | ||
// otlp_endpoint: "http://localhost:4317".to_string(), | ||
// log_level: Level::INFO, | ||
// log_format: LogFormat::Text, | ||
// log_file: None, | ||
// debug_host: "127.0.0.1".to_string(), | ||
// debug_server_port: 5555, | ||
// execution_mode: ExecutionMode::Enabled, | ||
// block_selection_policy: None, | ||
// external_state_root: false, | ||
// ignore_unhealthy_builders: false, | ||
// flashblocks: FlashblocksArgs::default(), | ||
// } | ||
// } | ||
// } |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commented-out code should be removed as it adds no value and clutters the codebase.
// health_check_interval: 60, | |
// max_unsafe_interval: 10, | |
// rpc_host: "127.0.0.1".to_string(), | |
// rpc_port: 8081, | |
// tracing: false, | |
// metrics: false, | |
// metrics_host: "127.0.0.1".to_string(), | |
// metrics_port: 9090, | |
// otlp_endpoint: "http://localhost:4317".to_string(), | |
// log_level: Level::INFO, | |
// log_format: LogFormat::Text, | |
// log_file: None, | |
// debug_host: "127.0.0.1".to_string(), | |
// debug_server_port: 5555, | |
// execution_mode: ExecutionMode::Enabled, | |
// block_selection_policy: None, | |
// external_state_root: false, | |
// ignore_unhealthy_builders: false, | |
// flashblocks: FlashblocksArgs::default(), | |
// } | |
// } | |
// } |
Copilot uses AI. Check for mistakes.
This PR consolidates the client configuration pattern across the codebase by introducing a unified
ClientArgs
struct that replaces the separateBuilderArgs
andL2ClientArgs
handling.Changes
Core refactoring:
ClientArgs
struct with unified JWT secret handlingBuilderArgs
/L2ClientArgs
toClientArgs
ClientArgs
withnew_rpc_client()
andnew_http_client()
methodsAPI improvements:
ProxyLayer
constructor to accept pre-configuredHttpClient
instances instead of raw configurationRollupBoostServer::new_from_args()
for cleaner server initialization from CLI argsClientArgs::get_auth_jwt()
Benefits
ClientArgs
patternTesting
All existing tests have been updated to use the new
ClientArgs
pattern and continue to pass.