Unable to Successfully Run Testnet With EigenLayer Contracts
This issue is currently being worked on in this branch
Goal/Intension:
We want to run local testnets for each of our AVSs (tangle-avs and incredible-squaring-avs). Each testnet needs to deploy the relevant EigenLayer Contracts. With a testnet running, the Operator of the AVS we are testing for should be able to successfully start, connect, and interact with the chain.
Problem or Current Unintended Behavior:
Deploying Contracts
Generally, when attempting to deploy the contracts from Rust, we get a "0x" error implying the address is wrong or the contract didn't get deployed correctly i.e., TransportError(ErrorResp(ErrorPayload { code: 3, message: "execution reverted", data: Some(RawValue("0x")) }))
Running the IncredibleSquaringDeployer.s.sol script with the following command
forge script script/IncredibleSquaringDeployer.s.sol:IncredibleSquaringDeployer --rpc-url 127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast -vvvv
results in the following error:
EIP-3855 is not supported in one or more of the RPCs used.
Unsupported Chain IDs: 31337.
Contracts deployed with a Solidity version equal or higher than 0.8.20 might not work properly.
For more information, please see https://eips.ethereum.org/EIPS/eip-3855
Traces:
[22394884] → new IncredibleSquaringDeployer@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
└─ ← [Return] 111640 bytes of code
Using the saved state JSON file from incredible-squaring-avs yields no error. But Registration still fails with the following error: TransportError(ErrorResp(ErrorPayload { code: 3, message: "execution reverted", data: Some(RawValue("0x")) })) On the Anvil side of things, we see the Error Error: reverted with: EvmError: Revert. This suggests that the Contracts are not the issue (requesting the code at the address of the contracts does return its bytecode. Instead, the problem likely originates from the BLS logic or the signing logic in utils/src/avs_registry/writer.rs.
⚠️NOTICE/UPDATE⚠️: Upon comparing the bytecode of the expected contract and the bytecode that is deployed for the RegistryCoordinator (the smart contract that the register function is being called from), they do not match. This explains the error and the problem here.
Attempted Solutions/Approaches:
Deploying Contracts
The first, primary approach was to deploy the necessary Contracts using Rust with Foundry. This is still in progress in the tests of each operator.rs file for tangle-avs and incredible-squaring-avs. While deploying contracts is straightforward and easily done in Rust, the complex/cyclic nature of the EigenLayer and AVS Contracts means that Proxies must be used when deploying the contracts. WIP
Currently, loading the chain from a saved state works. However, registration still fails with the error that was shown in the previous section (the "0x" revert error). Thus, the signing logic and all other relevant code is being investigated and debugged.The cause of this issue was found and noted in the section above.
Steps to Reproduce:
Deploying Contracts
Deploying the contracts with Rust can be reproduced directly with this repository. Currently, cloning this repo and running the test_anvil test will start testnet and attempt to deploy the contracts to it. Before being able to run this test, the contracts must be built by navigating to the contracts directory and running forge build. Since these tests are currently works-in-progress, it is not guaranteed that they run as intended at all times.
Deploying the contracts with the Incredible Squaring Deployer can be done with the incredible-squaring-avs repo. To reproduce the issue, you must build the contracts with forge build and then run the following command from the contracts directory: forge script script/IncredibleSquaringDeployer.s.sol:IncredibleSquaringDeployer --rpc-url 127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast -vvvv. The command listed in the deployer script itself is outdated and incorrect.
Loading Chain State From JSON
Reproducing this can be done by following the instructions in the README of the incredible-squaring-avs. These steps have to be done within the incredible-squaring-avs repo. The instructions are as follows:
You will need foundry and zap-pretty and docker to run the examples below.
curl -L https://foundry.paradigm.xyz | bash
foundryup
go install github.com/maoueh/zap-pretty@latest
You will also need to install docker, and build the contracts:
make build-contracts
Running via make
This simple session illustrates the basic flow of the AVS. The makefile commands are hardcoded for a single operator, but it's however easy to create new operator config files, and start more operators manually (see the actual commands that the makefile calls).
Start anvil in a separate terminal:
make start-anvil-chain-with-el-and-avs-deployed
Environment:
I am on Windows using WSL2 with Ubuntu 22.04.4 LTS
Unable to Successfully Run Testnet With EigenLayer Contracts
This issue is currently being worked on in this branch
Goal/Intension:
We want to run local testnets for each of our AVSs (tangle-avs and incredible-squaring-avs). Each testnet needs to deploy the relevant EigenLayer Contracts. With a testnet running, the Operator of the AVS we are testing for should be able to successfully start, connect, and interact with the chain.
Problem or Current Unintended Behavior:
Deploying Contracts
Generally, when attempting to deploy the contracts from Rust, we get a "0x" error implying the address is wrong or the contract didn't get deployed correctly i.e.,
TransportError(ErrorResp(ErrorPayload { code: 3, message: "execution reverted", data: Some(RawValue("0x")) }))
Running the IncredibleSquaringDeployer.s.sol script with the following command
forge script script/IncredibleSquaringDeployer.s.sol:IncredibleSquaringDeployer --rpc-url 127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast -vvvv
results in the following error:Loading Chain State From JSON
Using the saved state JSON file from incredible-squaring-avs yields no error. But Registration still fails with the following error:TransportError(ErrorResp(ErrorPayload { code: 3, message: "execution reverted", data: Some(RawValue("0x")) }))
On the Anvil side of things, we see the ErrorError: reverted with: EvmError: Revert
. This suggests that the Contracts are not the issue (requesting the code at the address of the contracts does return its bytecode. Instead, the problem likely originates from the BLS logic or the signing logic in utils/src/avs_registry/writer.rs.RegistryCoordinator
(the smart contract that the register function is being called from), they do not match. This explains the error and the problem here.Attempted Solutions/Approaches:
Deploying Contracts
[Revert] revert: ERC1967: new implementation is not a contract
Error shown in the previous section.Loading Chain State From JSON
Currently, loading the chain from a saved state works. However, registration still fails with the error that was shown in the previous section (the "0x" revert error). Thus, the signing logic and all other relevant code is being investigated and debugged.The cause of this issue was found and noted in the section above.Steps to Reproduce:
Deploying Contracts
test_anvil
test will start testnet and attempt to deploy the contracts to it. Before being able to run this test, the contracts must be built by navigating to the contracts directory and runningforge build
. Since these tests are currently works-in-progress, it is not guaranteed that they run as intended at all times.forge build
and then run the following command from the contracts directory:forge script script/IncredibleSquaringDeployer.s.sol:IncredibleSquaringDeployer --rpc-url 127.0.0.1:8545 --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --broadcast -vvvv
. The command listed in the deployer script itself is outdated and incorrect.Loading Chain State From JSON
Environment:
I am on Windows using WSL2 with Ubuntu 22.04.4 LTS