-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Moving Optimism bin to Optimism Cli #9439
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.
great!
a few more nits, then this is g2g
I'll need to go over a few things before we can merge this, because we need to update a few scripts that build the op-reth binary
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 pr should also remove the optimism commands from the reth
binary
and remove the whole optimism
feature from bin/reth
#[cfg(not(feature = "optimism"))] | ||
compile_error!("Cannot build the `op-reth` binary with the `optimism` feature flag disabled. Did you mean to build `reth`?"); | ||
|
||
#[cfg(feature = "optimism")] |
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.
lfg
crates/optimism/cli/src/lib.rs
Outdated
/// # Example | ||
/// | ||
/// ```no_run | ||
/// use reth::cli::Cli; | ||
/// use reth_node_optimism::OptimismNode; | ||
/// | ||
/// Cli::parse_args() | ||
/// .run(|builder, _| async move { | ||
/// let handle = builder.launch_node(OptimismNode::default()).await?; | ||
/// | ||
/// handle.wait_for_node_exit().await | ||
/// }) | ||
/// .unwrap(); | ||
/// ``` | ||
/// | ||
/// # Example | ||
/// | ||
/// Parse additional CLI arguments for the node command and use it to configure the node. | ||
/// | ||
/// ```no_run | ||
/// use clap::Parser; | ||
/// use reth::cli::Cli; | ||
/// | ||
/// #[derive(Debug, Parser)] | ||
/// pub struct MyArgs { | ||
/// pub enable: bool, | ||
/// } | ||
/// | ||
/// Cli::parse() | ||
/// .run(|builder, my_args: MyArgs| async move { | ||
/// // launch the node | ||
/// | ||
/// Ok(()) | ||
/// }) | ||
/// .unwrap(); | ||
/// ```` |
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.
maybe out of scope, but I would prefer these to be executable examples. easy to keep up to date with potential type name changes then using cargo test --doc
.
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.
we can finally do this now actually
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.
either it's in scope and this pr fixes it, or open an issue pls
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.
tysm!
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.
just checked, we need to do a few more things before we can finalize this
TODO
- remove all
-optimism-
crates from bin/reth - remove all usages of cfg(optimism) and only keep the ethereum code, like https://github.com/paradigmxyz/reth/blob/main/bin/reth/src/commands/debug_cmd/build_block.rs#L249-L253
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.
the code that has been deleted from bin/reth
, needs to move to reth-optimism-cli
. so this requires having a debug command in reth-optimism-cli
.
how's it going with this? need some help? I have a PR that's a dependent on this @loocapro |
Hi @emhane, since i removed some cfg flags, I am running in some workspace dependency issue here: https://github.com/paradigmxyz/reth/actions/runs/9909282475/job/27376994891?pr=9439 Any advice? |
[dependencies] | ||
reth-node-builder.workspace = true | ||
reth-cli-util.workspace = true | ||
reth-optimism-cli.workspace = true | ||
reth-tracing.workspace = true | ||
reth-node-optimism.workspace = true |
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.
in response to #9439 (comment):
you will have to add an optimism feature to this manifest, and then look through these deps, and see which has an optimism feature...so they can be included, just like for the other optimism crates - eventually we hope to get rid off this!
release builds work fine: https://github.com/paradigmxyz/reth/actions/runs/10144116336/job/28046941974?pr=9439 |
Thanks @joshieDo for taking this on!! Amazing work!! |
Closes #9408