-
Notifications
You must be signed in to change notification settings - Fork 36
Remove flashblocks conditional compilation #67
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
Conversation
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
Removes compile-time feature gates for flashblocks and unifies builder implementations under a runtime switch.
- Eliminates
cfg(feature = "flashblocks")conditionals and merges builder code into abuilders/folder - Introduces a
BuilderModeenum andPayloadBuildertrait to select between standard and flashblocks modes at runtime - Simplifies configuration and execution data types and consolidates argument parsing
Reviewed Changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/traits.rs | Define unified node, pool, client, and transaction bounds |
| src/tests/mod.rs | Always include vanilla and flashblocks tests |
| src/tests/framework/txs.rs | Remove unnecessary clone of bundle options |
| src/primitives/reth/execution.rs | Generalize ExecutionInfo to carry extra builder data |
| src/metrics.rs | Drop feature-gated metrics fields |
| src/main.rs | Switch to runtime builder mode and refactor startup logic |
| src/builders/mod.rs | Add PayloadBuilder trait and common BuilderConfig |
| src/builders/standard/mod.rs | Implement standard block builder |
| src/builders/flashblocks/config.rs | New FlashblocksConfig and extension trait |
| src/args/mod.rs | Enhance CLI with builder mode and playground defaults |
Comments suppressed due to low confidence (5)
crates/op-rbuilder/src/builders/mod.rs:108
- [nitpick] Using
debug_struct("Config")may be ambiguous in logs; consider renaming todebug_struct("BuilderConfig")for clarity.
.debug_struct("Config")
crates/op-rbuilder/src/builders/flashblocks/config.rs:44
- [nitpick] The trait is named
FlashBlocksConfigExtbut the struct isFlashblocksConfig(lowercaseb). For consistency, align the casing (e.g., rename toFlashblocksConfigExt).
pub trait FlashBlocksConfigExt {
crates/op-rbuilder/src/traits.rs:13
- The bound syntax
FullNodeTypes<Types: NodeTypes<…>>relies on unstable Rust features. For compatibility with stable Rust, constrain the associated type in a where clause, e.g.:T: FullNodeTypes, <T as FullNodeTypes>::Types: NodeTypes<Payload = …>.
FullNodeTypes<
Types: NodeTypes<Payload = OpEngineTypes, ChainSpec = OpChainSpec, Primitives = OpPrimitives>,
crates/op-rbuilder/src/tests/framework/txs.rs:145
- The
bundle_optsvariable is assigned but never used afterward, leading to an unused‐variable warning. Consider removing this binding or prefixing it with an underscore.
let bundle_opts = self.bundle_opts;
crates/op-rbuilder/src/main.rs:60
- Since
builder_argsis already owned, you can move it directly intotry_fromand avoid requiringCloneby writingtry_from(builder_args)instead of cloning.
let builder_config = BuilderConfig::<B::Config>::try_from(builder_args.clone())
|
Great pr! |
📝 Summary
This PR closes this issue: #55
We no longer need to compile two separate binaries to pick between having flashblocks builder versus vanilla (standard) builder. By default the flashblocks feature is disabled until it is stabilized.
As part of this change few things happened:
builders/💡 Motivation and Context
✅ I have completed the following steps:
make lintmake test