Layr-Labs / hello-world-avs

Hello World AVS
MIT License
63 stars 58 forks source link

The Hello World AVS does not work with latest EigenLayer smart contacts. #54

Closed wawrzek closed 1 month ago

wawrzek commented 2 months ago

After recent update to the EigenLayer smart contracts, the Hello World cannot be compiled.

The problem might be related to changes in the smart contracts (e.g. it seems that "rewardsCoordinator" and "rewardsCoordinatorImplementation" has been removed, and "delayedWithdrawalRouter" and "delayedWithdrawalRouterImplementation" has been added).

To Recreated

Error The deployment fails:

[⠊] Compiling...
No files changed, compilation skipped
Traces:
  [7795326] → new HelloWorldDeployer@0x5b73C5498c1E3b4dbA84de0F1833c4a029d90519
    └─ ← [Return] 38815 bytes of code

  [501151] HelloWorldDeployer::run()
    ├─ [0] VM::projectRoot() [staticcall]
    │   └─ ← [Return] "/Users/wawrzek/Ethereum/EigenLayer/hello-world-avs/contracts"
    ├─ [0] VM::toString(32382 [3.238e4]) [staticcall]
    │   └─ ← [Return] "32382"
    ├─ [0] VM::readFile("/Users/wawrzek/Ethereum/EigenLayer/hello-world-avs/contracts/script/output/32382/eigenlayer_deployment_output.json") [staticcall]
    │   └─ ← [Return] <file>
    ├─ [0] VM::parseJsonAddress("<stringified JSON>", ".addresses.strategyManager") [staticcall]
    │   └─ ← [Return] 0x75A5d120897A76224a3E8e62dC0F18cc808F739d
    ├─ [0] VM::parseJsonAddress("<stringified JSON>", ".addresses.delegation") [staticcall]
    │   └─ ← [Return] 0x30bdaE426d3CBD42e9d41D23958Fac6AD8310f81
    ├─ [0] VM::parseJsonAddress("<stringified JSON>", ".addresses.avsDirectory") [staticcall]
    │   └─ ← [Return] 0x8BfC4B63Cb65d1004c9e9a0a8982915Dc9aAAf29
    ├─ [0] VM::parseJsonAddress("<stringified JSON>", ".addresses.eigenLayerProxyAdmin") [staticcall]
    │   └─ ← [Return] 0x3e2AabB763F255CbB6a322DBe532192e120B5C6B
    ├─ [0] VM::parseJsonAddress("<stringified JSON>", ".addresses.eigenLayerPauserReg") [staticcall]
    │   └─ ← [Return] 0x3B92c21Ad01E7091513eAb0c26C28B8Ba1Ee21ab
    ├─ [0] VM::parseJsonAddress("<stringified JSON>", ".addresses.baseStrategyImplementation") [staticcall]
    │   └─ ← [Return] 0xF3073ab62A79c316D58556555771de5A906c7E54
    ├─ [0] VM::startBroadcast()
    │   └─ ← [Return]
    ├─ [264306] → new ERC20Mock@0x439a926961EFc90dFD19f952F79A2b07530059f9
    │   └─ ← [Return] 1320 bytes of code
    ├─ [127242] → new <unknown>@0x3a63ac6a25cb4ed2c85A8A986F4032003e5dC734
    │   ├─ emit Upgraded(implementation: 0xF3073ab62A79c316D58556555771de5A906c7E54)
    │   ├─ [98589] 0xF3073ab62A79c316D58556555771de5A906c7E54::initialize(1000000000000000000 [1e18], 100000000000000000000 [1e20], ERC20Mock: [0x439a926961EFc90dFD19f952F79A2b07530059f9], 0x3B92c21Ad01E7091513eAb0c26C28B8Ba1Ee21ab) [delegatecall]
    │   │   ├─ emit MaxPerDepositUpdated(previousValue: 0, newValue: 1000000000000000000 [1e18])
    │   │   ├─ emit MaxTotalDepositsUpdated(previousValue: 0, newValue: 100000000000000000000 [1e20])
    │   │   ├─ emit Paused(account: 0x123463a4B065722E99115D6c222f267d9cABb524, newPausedStatus: 0)
    │   │   ├─ emit PauserRegistrySet(pauserRegistry: 0x0000000000000000000000000000000000000000, newPauserRegistry: 0x3B92c21Ad01E7091513eAb0c26C28B8Ba1Ee21ab)
    │   │   ├─ [171] ERC20Mock::decimals() [staticcall]
    │   │   │   └─ ← [Revert] EvmError: Revert
    │   │   └─ ← [Revert] EvmError: Revert
    │   └─ ← [Revert] revert: Address: low-level delegate call failed
    └─ ← [Revert] revert: Address: low-level delegate call failed

Error:
script failed: revert: Address: low-level delegate call failed
wesfloyd commented 2 months ago

Hi @wawrzek thanks for raising this.

Two followup questions for you: 1) Which local rpc network is this running? Eg an instance of anvil or another local chain via ivy-net & docker? 2) Can you please try adding "debug" to the end of your deploy script (similar to this example), retest and share your results?

wawrzek commented 2 months ago

@wesfloyd -

1) The above instruction is for the iv1, which is based on https://github.com/ivy-net/eth-pos-devnet/, a docker based POS network. However, I think I had the same results trying with Anvil.

2) I'm not a solidity contract expert and not sure how to exactly use the forge debugger, but going to the end of execution (pressing G) lead to the following state:

Screenshot 2024-08-28 at 09 55 17

Can it be related to this change: https://coinmarketcap.com/community/articles/66cd5f9e3f81523fbd09db1f/ ?

wesfloyd commented 2 months ago

Thank you for raising this issue. I can confirm that there are multiple issues and outdated libraries with the current master branch. We are close to merging in many fixes to the mainline codebase via these PRs: https://github.com/Layr-Labs/hello-world-avs/pull/57 https://github.com/Layr-Labs/hello-world-avs/pull/58

If you can bear with us for another few days, we'll have it cleaned up for you 👍

wawrzek commented 2 months ago

Thanks for the info. I'll follow the PRs.