Skip to content
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

feat(l2): make deposits for the rich accounts #2095

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

tomip01
Copy link
Contributor

@tomip01 tomip01 commented Feb 26, 2025

Motivation

In this PR we change the behavior of the deployer. We make deposits from the rich accounts to the L1 in the L2 common bridge to make the rich accounts of the L2.

Description

  • We add a make_deposits() function in the deployer.rs. Here we iterate from the Private Keys of the L1, calculate their addresses and make a deposit
  • We add a new file private_keys_l1
  • We add new volumes and environment variables to the docker-compose-l2.yaml for the files of the private keys and genesis to be able to read them
  • We remove the extra accounts from the genesis-l2.json

Closes #2017

Copy link

github-actions bot commented Feb 26, 2025

Lines of code report

Total lines added: 79
Total lines removed: 4
Total lines changed: 83

Detailed view
+-------------------------------------------+-------+------+
| File                                      | Lines | Diff |
+-------------------------------------------+-------+------+
| ethrex/cmd/ethrex_l2/src/commands/test.rs | 224   | -1   |
+-------------------------------------------+-------+------+
| ethrex/crates/l2/contracts/deployer.rs    | 656   | +74  |
+-------------------------------------------+-------+------+
| ethrex/crates/l2/proposer/l1_watcher.rs   | 245   | -3   |
+-------------------------------------------+-------+------+
| ethrex/crates/l2/utils/mod.rs             | 5     | +1   |
+-------------------------------------------+-------+------+
| ethrex/crates/l2/utils/parse.rs           | 4     | +4   |
+-------------------------------------------+-------+------+

* Now fetching from block 0
* deposits are working
* it implies that no hardcoding of the starting block of the watcher
* use last block observed from the contract
* divide by 2 the current deposit
* missing the L2 and L1 same addresses and keys
@tomip01 tomip01 force-pushed the l2/deposit-rich-accounts branch from d936aa4 to 29f9a04 Compare February 27, 2025 22:04
@tomip01 tomip01 self-assigned this Mar 5, 2025
@tomip01 tomip01 added L2 Rollup client L1 Ethereum client labels Mar 5, 2025
@tomip01 tomip01 changed the title L2/deposit rich accounts feat(l2): make deposits for the rich accounts Mar 5, 2025
@tomip01 tomip01 marked this pull request as ready for review March 5, 2025 17:47
@tomip01 tomip01 requested a review from a team as a code owner March 5, 2025 17:47
@jrchatruc
Copy link
Collaborator

The genesis-l2.json file still has all the rich accounts, they should be removed

@tomip01
Copy link
Contributor Author

tomip01 commented Mar 7, 2025

The genesis-l2.json file still has all the rich accounts, they should be removed

Nice catch!, changed here 9ee11bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L1 Ethereum client L2 Rollup client
Projects
Status: No status
Status: No status
Development

Successfully merging this pull request may close these issues.

Make L2 rich accounts properly deposit their funds from L1
2 participants