Skip to content

Conversation

teddyknox
Copy link

@teddyknox teddyknox commented Oct 7, 2025

This PR consolidates the client configuration pattern across the codebase by introducing a unified ClientArgs struct that replaces the separate BuilderArgs and L2ClientArgs handling.

Changes

Core refactoring:

  • Introduced ClientArgs struct with unified JWT secret handling
  • Added conversion traits from BuilderArgs/L2ClientArgs to ClientArgs
  • Moved client instantiation logic into ClientArgs with new_rpc_client() and new_http_client() methods
  • Bump minor versions of reth-optimism-payload-builder and alloy-consensus, resolving dependency conflicts that arise inside kona-node when depending on rollup-boost.

API improvements:

  • Updated ProxyLayer constructor to accept pre-configured HttpClient instances instead of raw configuration
  • Added RollupBoostServer::new_from_args() for cleaner server initialization from CLI args
  • Consolidated JWT secret resolution logic into ClientArgs::get_auth_jwt()

Benefits

  • Reduced code duplication: JWT handling and client creation logic is now centralized
  • Cleaner separation of concerns: Configuration parsing is separate from client instantiation
  • Improved testability: Tests now use consistent ClientArgs pattern
  • Better maintainability: Single source of truth for client configuration

Testing

All existing tests have been updated to use the new ClientArgs pattern and continue to pass.

Copy link

vercel bot commented Oct 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
rollup-boost Ignored Ignored Preview Oct 20, 2025 0:34am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

@@ -1,22 +1,38 @@
#[cfg(all(feature = "server", feature = "metrics-exporter-prometheus"))]
Copy link
Collaborator

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

Copy link
Author

@teddyknox teddyknox Oct 19, 2025

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")]
Copy link
Collaborator

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)

Copy link
Author

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.

@SozinM
Copy link
Collaborator

SozinM commented Oct 9, 2025

TBH i feel that we need more in-depth split of binary-library
I propose to have additional crate for binary that uses library crate

@teddyknox teddyknox marked this pull request as draft October 9, 2025 14:10
@teddyknox teddyknox marked this pull request as ready for review October 19, 2025 23:37
@Copilot Copilot AI review requested due to automatic review settings October 19, 2025 23:37
Copy link

@Copilot Copilot AI left a 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.

* 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
@Copilot Copilot AI review requested due to automatic review settings October 20, 2025 00:34
Copy link

@Copilot Copilot AI left a 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.

Comment on lines +219 to +240
// 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(),
// }
// }
// }
Copy link

Copilot AI Oct 20, 2025

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.

Suggested change
// 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants