Replace ganache-cli with anvil (#3555)

## Issue Addressed

N/A

## Proposed Changes

Replace ganache-cli with anvil https://github.com/foundry-rs/foundry/blob/master/anvil/README.md
We can lose all js dependencies in CI as a consequence.

## Additional info
Also changes the ethers-rs version used in the execution layer (for the transaction reconstruction) to a newer one. This was necessary to get use the ethers utils for anvil. The fixed execution engine integration tests should catch any potential issues with the payload reconstruction after #3592 


Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
Pawan Dhananjay
2023-05-15 07:22:02 +00:00
parent 3c029d48bf
commit 8a3eb4df9c
24 changed files with 465 additions and 506 deletions

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Requires `lighthouse`, ``lcli`, `ganache`, `curl`, `jq`
# Requires `lighthouse`, ``lcli`, `anvil`, `curl`, `jq`
BEHAVIOR=$1
@@ -23,12 +23,12 @@ source ./vars.env
exit_if_fails ../local_testnet/clean.sh
echo "Starting ganache"
echo "Starting anvil"
exit_if_fails ../local_testnet/ganache_test_node.sh &> /dev/null &
GANACHE_PID=$!
exit_if_fails ../local_testnet/anvil_test_node.sh &> /dev/null &
ANVIL_PID=$!
# Wait for ganache to start
# Wait for anvil to start
sleep 5
echo "Setting up local testnet"
@@ -79,7 +79,7 @@ if [[ "$BEHAVIOR" == "failure" ]]; then
echo "Shutting down"
# Cleanup
kill $BOOT_PID $BEACON_PID $BEACON_PID2 $BEACON_PID3 $GANACHE_PID $VALIDATOR_1_PID $VALIDATOR_2_PID $VALIDATOR_3_PID
kill $BOOT_PID $BEACON_PID $BEACON_PID2 $BEACON_PID3 $ANVIL_PID $VALIDATOR_1_PID $VALIDATOR_2_PID $VALIDATOR_3_PID
echo "Done"
@@ -144,7 +144,7 @@ if [[ "$BEHAVIOR" == "success" ]]; then
# Cleanup
cd $PREVIOUS_DIR
kill $BOOT_PID $BEACON_PID $BEACON_PID2 $BEACON_PID3 $GANACHE_PID $VALIDATOR_1_PID $VALIDATOR_2_PID $VALIDATOR_3_PID $VALIDATOR_4_PID
kill $BOOT_PID $BEACON_PID $BEACON_PID2 $BEACON_PID3 $ANVIL_PID $VALIDATOR_1_PID $VALIDATOR_2_PID $VALIDATOR_3_PID $VALIDATOR_4_PID
echo "Done"

View File

@@ -4,7 +4,7 @@ DATADIR=~/.lighthouse/local-testnet
# Directory for the eth2 config
TESTNET_DIR=$DATADIR/testnet
# Mnemonic for the ganache test network
# Mnemonic for the anvil test network
ETH1_NETWORK_MNEMONIC="vast thought differ pull jewel broom cook wrist tribe word before omit"
# Hardcoded deposit contract based on ETH1_NETWORK_MNEMONIC