Skip to content

refactor(l2): rewrite deployer and system contracts updater bins #2643

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

Merged
merged 52 commits into from
May 7, 2025

Conversation

ilitteri
Copy link
Contributor

@ilitteri ilitteri commented Apr 29, 2025

Motivation

Description

  • Adds CLI options for the contract deployer bin and the system contracts updater bin (removing the need of a config file).
  • Updates the L2 Makefile.
  • Updates the Docker Compose files.
  • Updates the pr-main_l2 workflow.
  • Updates the L2 integration test.
  • Removes the sequencer_config_example.toml since it is not needed anymore.
  • Refactors the crates/l2/contracts module
    • Renames the crate from ethrex-l2_deployer to ethrex-l2_contracts.
    • Adds a bin module with the bins ethrex_l2_l1_deployer and ethrex_l2_system_contracts_updater.
    • All the SDK-related logic was moved to the SDK lib.
  • Cleans up the logic related to the config and toml parsing since now the only bin relying on the config is the Prover. Everything relative to the sequencer was removed, and now it is "hardcoded" for the Prover.

Closes #2609.

- Add deploy_contract function
- Add compile_contract function
- Add initialize_contract function
- Move to `bin/system_contract_updates` module
- Add `cli.rs` module with simple arg parser
- Add `error.rs` module
- Move to `bin/deployer` module
- Add `cli.rs` module with simple arg parser
- Add `error.rs` module
@ilitteri ilitteri requested a review from a team as a code owner April 29, 2025 19:10
Copy link

github-actions bot commented Apr 29, 2025

Lines of code report

Total lines added: 934
Total lines removed: 173
Total lines changed: 1107

Detailed view
+------------------------------------------------------------------+-------+------+
| File                                                             | Lines | Diff |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/deployer/cli.rs                   | 228   | +228 |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/deployer/error.rs                 | 32    | +32  |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/deployer/main.rs                  | 430   | +430 |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/system_contracts_updater/cli.rs   | 21    | +21  |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/system_contracts_updater/error.rs | 13    | +13  |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/bin/system_contracts_updater/main.rs  | 34    | +34  |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/sdk/src/sdk.rs                                  | 390   | +176 |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/utils/config/mod.rs                             | 83    | -38  |
+------------------------------------------------------------------+-------+------+
| ethrex/crates/l2/utils/config/toml_parser.rs                     | 80    | -135 |
+------------------------------------------------------------------+-------+------+

@ilitteri ilitteri marked this pull request as draft April 29, 2025 19:21
@ilitteri ilitteri marked this pull request as ready for review May 5, 2025 16:29
@ilitteri ilitteri self-assigned this May 5, 2025
@ilitteri ilitteri added the L2 Rollup client label May 5, 2025
Copy link
Contributor

@ManuelBilbao ManuelBilbao left a comment

Choose a reason for hiding this comment

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

Looks very nice overall

@ilitteri ilitteri merged commit 03b966b into replace_sequencer_config May 7, 2025
31 checks passed
@ilitteri ilitteri deleted the l1_deployer_cli branch May 7, 2025 20:01
@github-project-automation github-project-automation bot moved this to Done in ethrex_l2 May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L2 Rollup client
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants