Skip to content

Conversation

@ManuelBilbao
Copy link
Contributor

@ManuelBilbao ManuelBilbao commented Aug 11, 2025

Motivation

Current deployer is meant to be used in development only and is hard to use for people without much context.

Description

The main idea of this PR is to be able to use the deployer from the binary without the need of the repo source code.
Simplify deployer CLI and review defaults. Refactor code to remove unused and unneeded code.

TDX deployment is still pending to refactor, will be addressed in another PR

@ManuelBilbao ManuelBilbao self-assigned this Aug 11, 2025
@ManuelBilbao ManuelBilbao added L2 Rollup client cli Command line interface labels Aug 11, 2025
@github-actions
Copy link

github-actions bot commented Aug 11, 2025

Lines of code report

Total lines added: 1
Total lines removed: 94
Total lines changed: 95

Detailed view
+----------------------------------+-------+------+
| File                             | Lines | Diff |
+----------------------------------+-------+------+
| ethrex/cmd/ethrex/l2/deployer.rs | 905   | -87  |
+----------------------------------+-------+------+
| ethrex/cmd/ethrex/l2/options.rs  | 832   | +1   |
+----------------------------------+-------+------+
| ethrex/crates/l2/sdk/src/sdk.rs  | 882   | -6   |
+----------------------------------+-------+------+
| ethrex/crates/l2/utils/mod.rs    | 2     | -1   |
+----------------------------------+-------+------+

@ManuelBilbao ManuelBilbao marked this pull request as ready for review August 12, 2025 19:35
Copilot AI review requested due to automatic review settings August 12, 2025 19:35
@ManuelBilbao ManuelBilbao requested a review from a team as a code owner August 12, 2025 19:35
Copy link
Contributor

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 refactors the L2 deployer to simplify its CLI interface and improve usability. The changes restructure the deployer command-line arguments, remove unused code, and standardize environment variable naming patterns.

  • Restructures deployer CLI arguments for better organization and usability
  • Removes unused test data I/O utilities and refactors code organization
  • Updates environment variable naming for consistency across the codebase

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cmd/ethrex/l2/deployer.rs Major refactor of deployer CLI interface, argument structure, and contract deployment logic
cmd/ethrex/l2/command.rs Updates to use new Signer interface for contract calls
cmd/ethrex/l2/options.rs Adds default RPC URL value to eth options
crates/l2/utils/test_data_io.rs Completely removes unused test data I/O utilities
crates/l2/utils/mod.rs Removes reference to deleted test_data_io module
crates/l2/sdk/src/sdk.rs Updates call_contract function signature and removes unused initialize_contract function
crates/l2/sequencer/utils.rs Makes DEV_MODE_ADDRESS constant public
Multiple config files Updates environment variable names and path references for consistency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

.env("PRIVATE_KEY", hex::encode(opts.private_key.as_ref()))
.env("RPC_URL", &opts.rpc_url)
// TODO: This can panic
.env("RPC_URL", &opts.eth_options.rpc_url[0])
Copy link

Copilot AI Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can panic if opts.eth_options.rpc_url is empty. The TODO comment acknowledges this issue but it should be addressed. Consider using .get(0) and handling the None case or adding validation earlier in the function.

Suggested change
.env("RPC_URL", &opts.eth_options.rpc_url[0])
.env(
"RPC_URL",
opts.eth_options.rpc_url.get(0).ok_or_else(|| {
DeployerError::DeploymentSubtaskFailed(
"No RPC URL provided in eth_options.rpc_url".to_string(),
)
})?,
)

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <[email protected]>
@ManuelBilbao ManuelBilbao marked this pull request as draft September 9, 2025 13:23
@ManuelBilbao ManuelBilbao marked this pull request as ready for review September 16, 2025 21:15
Copy link
Contributor

@LeanSerra LeanSerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left some comments.

Copy link
Contributor

@tomip01 tomip01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can link and close this issue #2787

@fedacking
Copy link
Contributor

Due to shifting priorities, this PR wasn't merged in time and is now really far behind. We close it for now to remake it at a later date.

@fedacking fedacking closed this Oct 31, 2025
@github-project-automation github-project-automation bot moved this from Conflicts with Main to Done in ethrex_l2 Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Command line interface L2 Rollup client

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

L2: embed VKs to contract Deployer

6 participants