-
Notifications
You must be signed in to change notification settings - Fork 117
feat(l2): enable command flags for l2 --dev
#4880
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
Enable honoring CLI flags for l2 --dev by hydrating missing Option fields from Defaults and setting a default QPL tool path for the proof coordinator.
- Introduce populate_with_defaults across L2 option structs to apply defaults only for unset fields
- Set a default proof_coordinator_qpl_tool_path and wire population in the l2 --dev flow
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| cmd/ethrex/l2/options.rs | Adds populate_with_defaults for Options and nested structs; introduces DEFAULT_PROOF_COORDINATOR_QPL_TOOL_PATH; updates Default for ProofCoordinatorOptions. |
| cmd/ethrex/l2/command.rs | Calls populate_with_defaults in the --dev path after setting node_opts to default_l2. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Lines of code reportTotal lines added: Detailed view |
This reverts commit 1278021.
cmd/ethrex/l2/options.rs
Outdated
| /// Sets the value of an Option<T> to a default if it is currently None. | ||
| /// If the target already contains a value, it is left unchanged. | ||
| /// Useful for populating option fields with defaults when not specified by the user. |
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.
Isn't this a Option::or()
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.
Yes, nice catch.
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.
Done here 7c1b09c
Motivation
When running
ethrex l2 --devthe sequencer flags are being ignored. We want to be able to configure the L2Description
populate_with_defaultsfunction for L2 options. This function assigns default values to anyOption<T>flags that are not provided when runningl2 --dev, instead of leaving them as None.defaultimplementation forProofCoordinatorOptionsto setproof_coordinator_qpl_tool_pathas the one in the cli