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(fevm): L3 testing #1084

Draft
wants to merge 68 commits into
base: main
Choose a base branch
from
Draft

feat(fevm): L3 testing #1084

wants to merge 68 commits into from

Conversation

maximopalopoli
Copy link
Contributor

@maximopalopoli maximopalopoli commented Nov 5, 2024

Motivation

The goal is to make a test with a real use case, plugging an L2 to another L2 to do a further testing of Levm. Currently is failing because of levm.

Description

The changes are the result of debugging the execution.

How to Reproduce It

Deploy L2

First, you have to set up your L2. That can be done with a normal procedure of set up, but we'll start in main branch.

Once you clone the repo, and you're on the main branch, go to crates/l2 and create a .env file, you can take the .envexample as a sample. Then you can run make restart. That will do a docker compose up to the L1 image and run the L2.

Here you can verify a few things to make sure everything is alright:

  • Maybe the L1_WATCHER_L2_PROPOSER_ADDRESS is missing. It can be the same as DEPLOYER_ADDRESS (and PROPOSER_L1_ADDRESS)
  • When running the make restart the first step is deploying the contracts of Bridge and On Chain proposer, and after that the program prints those addresses. You can verify the printed addresses are the same as those in the .env file.
  • Maybe you have an error like this: Invalid params: duplicate field input. This happened to me, and i fixed it by changing a flag in a type's attribute, removing in /crates/common/types/transactions.rs on the GenericTransaction type the alias = "data" on the input attribute.
  • If you tried the previous tips and the running is still failing, maybe there is a cache problem or similar. For that reason, we are going to use the command below.

From now on, instead of the previous one, we will use this execution command:
rm /Users/<your-username>/Library/Application\ Support/ethereum_rust/mdbx.*; make restart-local-l1 && make deploy-l1 && make down-l2 && RUST_LOG=info,ethereum_rust_blockchain::payload=debug cargo run --release --manifest-path ../../Cargo.toml --bin ethereum_rust --features l2 -- --network ../../test_data/genesis-l2.json --http.port 1729

If you want, you can try to send a transaction to try the system, maybe it's failing at this steps and you don't really know. Try it with:
cast send --private-key 0x63b8139bbf84a5a65613e544be239f59f884434462598bd8bfe9f2c9045aa336 --value 10 0x0004ad0D0823e3d31C6ECA2A3495373fA76c43aC --rpc-url http://localhost:1729/

If it fails, check the above verifications.

Now, you can change the branch of the L2 to this, or the branch you want to test.

Deploy L3
First, we need to clone again the repo in another directory. Ten, we'll have to change some parameters to make the L3 to plug in the L2. We'll need a new rich account, you can find one in the test_data folder (from the root of the project).

The parameters we'll need to change are:

ETH_RPC_URL=http://localhost:1729 // Now ETH_RPC_URL is L2's URL
L1_WATCHER_BRIDGE_ADDRESS= // See this address when deploying
L1_WATCHER_L2_PROPOSER_PRIVATE_KEY= // Search a rich wallet from L2 (must match with address)
L1_WATCHER_L2_PROPOSER_ADDRESS= // Search a rich wallet from L2 (must match with PK)
ENGINE_API_RPC_URL=http://localhost:8552 // Use a different from L2
PROVER_SERVER_LISTEN_PORT=3030
PROVER_PROVER_SERVER_ENDPOINT=localhost:3030
PROPOSER_ON_CHAIN_PROPOSER_ADDRESS= // See this address in deploying logs
PROPOSER_L1_ADDRESS= // Use the same as L1_WATCHER_L2_PROPOSER_ADDRESS
PROPOSER_L1_PRIVATE_KEY= // Use the same as L1_WATCHER_L2_PROPOSER_PRIVATE_KEY
DEPLOYER_ADDRESS= // Use the same as L1_WATCHER_L2_PROPOSER_ADDRESS
DEPLOYER_PRIVATE_KEY= // Use the same as L1_WATCHER_L2_PROPOSER_PRIVATE_KEY

The other parameters can be taken from L2's .env file.

Now we will try to deploy the contracts of the bridge and on chain proposer, with this command:
cargo run --release --bin ethereum_rust_l2_l1_deployer --manifest-path contracts/Cargo.toml

This will can fail or not, but the problems will be probably from Levm execution, so that's what we have to work on.

After fixing that you wold execute the L3 with the following command:
cargo run --release --manifest-path ../../Cargo.toml --bin ethereum_rust --features l2 -- --network ../../test_data/genesis-l2.json --http.port 3458 --authrpc.port 8552 --datadir ./ethereum_rust_l3

And if it runs, try to run some transactions, maybe one can be the cast send that I mentioned above.

juanimedone and others added 25 commits October 30, 2024 10:28
**Motivation**

<!-- Why does this pull request exist? What are its goals? -->
fix some things generic_call in l1 integration because of merge.

**Description**

<!-- A clear and concise general description of the changes this PR
introduces -->

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #issue_number
@maximopalopoli maximopalopoli added the levm Lambda EVM implementation label Nov 5, 2024
@maximopalopoli maximopalopoli self-assigned this Nov 5, 2024
Base automatically changed from levm-ethereum-rust-integration to main November 6, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
levm Lambda EVM implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants