-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: add script to support sequencer (#37) * refactor: refactor pos script * chore: update gitignore * chore: install lighthouse with specified commit id * fix: fix tx filter * refactor: refactor script, remove validator keys and genesis config * refactor: refactor scripts * fix: fix scripts * fix: fix the Absolute Path for scripts * refactor: refactor scripts
- Loading branch information
1 parent
35d99f3
commit 447d871
Showing
14 changed files
with
275 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
set -e | ||
|
||
CURRENT_PATH=$( cd "$( dirname "$0" )" && pwd ) | ||
PROJECT_PATH=$(dirname "${CURRENT_PATH}") | ||
echo "PROJECT_PATH: ${PROJECT_PATH}" | ||
|
||
LIGHTHOUSE_SOURCE_PATH="${PROJECT_PATH}/tmp/lighthouse-source" | ||
echo "LIGHTHOUSE_SOURCE_PATH: ${LIGHTHOUSE_SOURCE_PATH}" | ||
|
||
if [ ! -d "${LIGHTHOUSE_SOURCE_PATH}" ]; then | ||
mkdir -p "${LIGHTHOUSE_SOURCE_PATH}" | ||
fi | ||
|
||
cd ${LIGHTHOUSE_SOURCE_PATH} | ||
|
||
echo "Removing existing lighthouse source" | ||
rm -rf ./* | ||
|
||
echo "Cloning lighthouse source" | ||
git clone https://github.com/sigp/lighthouse.git | ||
cd lighthouse | ||
|
||
## lighthouse tag: v5.2.1 | ||
echo "Checkout lighthouse commit: 9e12c21f268c80a3f002ae0ca27477f9f512eb6f" | ||
git checkout 9e12c21f268c80a3f002ae0ca27477f9f512eb6f | ||
|
||
echo "Build and Install lighthouse" | ||
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
set -e | ||
|
||
CURRENT_PATH=$( cd "$( dirname "$0" )" && pwd ) | ||
PROJECT_PATH=$(dirname "${CURRENT_PATH}") | ||
echo "PROJECT_PATH: ${PROJECT_PATH}" | ||
|
||
INSTALL_PATH="${PROJECT_PATH}/tmp/tools/bin" | ||
echo "Tools INSTALL_PATH: ${INSTALL_PATH}" | ||
if [ ! -d "${PROJECT_PATH}/tmp/tools" ]; then | ||
mkdir -p "${PROJECT_PATH}/tmp/tools" | ||
fi | ||
|
||
cd "${PROJECT_PATH}/tmp/tools" | ||
|
||
echo "Removing existing eth2-val-tools" | ||
rm -rf ./* | ||
|
||
echo "Cloning eth2-val-tools" | ||
git clone https://github.com/protolambda/eth2-val-tools.git | ||
cd eth2-val-tools | ||
|
||
echo "Checkout eth2-val-tools commit: 0d6d1ddb36479e73d7d876b29ac2d10ab3988e85" | ||
git checkout 0d6d1ddb36479e73d7d876b29ac2d10ab3988e85 | ||
|
||
echo "Build eth2-val-tools, target path: ${INSTALL_PATH}" | ||
go build -o ${INSTALL_PATH}/eth2-val-tools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
set -e | ||
|
||
CURRENT_PATH=$( cd "$( dirname "$0" )" && pwd ) | ||
PROJECT_PATH=$(dirname "${CURRENT_PATH}") | ||
echo "PROJECT_PATH: ${PROJECT_PATH}" | ||
|
||
VALIDATOR_KEYS_PATH="${PROJECT_PATH}/testdata/layer2/pos/validator-keys" | ||
echo "VALIDATOR_KEYS_PATH: ${VALIDATOR_KEYS_PATH}" | ||
|
||
echo "Removing existing validator keys" | ||
rm -rf ${VALIDATOR_KEYS_PATH} | ||
|
||
DEFAULT_MNEMONIC="giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete" | ||
echo "Default mnemonic: ${DEFAULT_MNEMONIC}" | ||
|
||
DEFAULT_TOOLS_BIN_PATH="${PROJECT_PATH}/tmp/tools/bin/eth2-val-tools" | ||
echo "DEFAULT_TOOLS_BIN_PATH: ${DEFAULT_TOOLS_BIN_PATH}" | ||
if [ ! -f "${DEFAULT_TOOLS_BIN_PATH}" ]; then | ||
echo "eth2-val-tools binary not found: ${DEFAULT_TOOLS_BIN_PATH}, please run make build_eth2_validator_tools or scripts/build-eth2-validator-tools.sh" | ||
exit 1 | ||
fi | ||
|
||
${DEFAULT_TOOLS_BIN_PATH} keystores \ | ||
--insecure \ | ||
--prysm-pass password \ | ||
--out-loc ${VALIDATOR_KEYS_PATH} \ | ||
--source-mnemonic "${DEFAULT_MNEMONIC}" \ | ||
--source-min 0 \ | ||
--source-max 64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
set -e | ||
|
||
#CURRENT_PATH=$(pwd) | ||
CURRENT_PATH=$( cd "$( dirname "$0" )" && pwd ) | ||
PROJECT_PATH=$(dirname "${CURRENT_PATH}") | ||
echo "PROJECT_PATH: ${PROJECT_PATH}" | ||
|
||
GENESIS_PATH="${PROJECT_PATH}/testdata/layer2/pos/el-cl-genesis-data" | ||
echo "GENESIS_PATH: ${GENESIS_PATH}" | ||
|
||
echo "Removing existing genesis data: ${GENESIS_PATH}" | ||
rm -rf ${GENESIS_PATH} | ||
|
||
FILE_DIR="${PROJECT_PATH}/testdata/layer2/pos" | ||
FILE_PATH="${FILE_DIR}/values.env" | ||
echo "Updating GENESIS_TIMESTAMP in ${FILE_PATH}" | ||
|
||
current_utc_timestamp=$(date -u +%s) | ||
echo "current_utc_timestamp: ${current_utc_timestamp}" | ||
OS="$(uname -s)" | ||
case "${OS}" in | ||
Linux*) | ||
echo "Running on Linux" | ||
sed -i "s/GENESIS_TIMESTAMP=[0-9]*/GENESIS_TIMESTAMP=$current_utc_timestamp/" $FILE_PATH | ||
;; | ||
Darwin*) | ||
echo "Running on macOS" | ||
sed -i '' "s/GENESIS_TIMESTAMP=[0-9]*/GENESIS_TIMESTAMP=$current_utc_timestamp/" $FILE_PATH | ||
;; | ||
*) | ||
echo "Unknown OS: ${OS}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# generate genesis data | ||
echo "Generating genesis data: ${GENESIS_PATH}" | ||
docker run --rm -it \ | ||
-v ${GENESIS_PATH}:/data \ | ||
-v ${FILE_PATH}:/config/values.env \ | ||
ethpandaops/ethereum-genesis-generator:3.2.1 all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set -e | ||
|
||
CURRENT_PATH=$( cd "$( dirname "$0" )" && pwd ) | ||
PROJECT_PATH=$(dirname "${CURRENT_PATH}") | ||
cd "${PROJECT_PATH}/testdata/layer2/pos" | ||
|
||
eigen-zeth init --datadir ../../../tmp/layer2/execution-data --chain el-cl-genesis-data/metadata/genesis.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
set -e | ||
|
||
#CURRENT_PATH=$(pwd) | ||
CURRENT_PATH=$( cd "$( dirname "$0" )" && pwd ) | ||
PROJECT_PATH=$(dirname "${CURRENT_PATH}") | ||
echo "PROJECT_PATH: ${PROJECT_PATH}" | ||
|
||
GENESIS_PATH="${PROJECT_PATH}/testdata/layer2/pos/el-cl-genesis-data" | ||
if [ ! -d "${GENESIS_PATH}" ]; then | ||
echo "Genesis directory not found at ${GENESIS_PATH}" | ||
exit 1 | ||
fi | ||
echo "GENESIS_PATH: ${GENESIS_PATH}" | ||
|
||
TESTNET_DIR="${GENESIS_PATH}/metadata" | ||
echo "TESTNET_DIR: ${TESTNET_DIR}" | ||
|
||
CHAIN_SPEC_PATH="${TESTNET_DIR}/genesis.json" | ||
echo "CHAIN_SPEC_PATH: ${CHAIN_SPEC_PATH}" | ||
|
||
CHAIN_DATA_PATH_PREFIX="${PROJECT_PATH}/tmp/layer2" | ||
echo "CHAIN_DATA_PATH_PREFIX: ${CHAIN_DATA_PATH_PREFIX}" | ||
|
||
EXECUTION_DATA_PATH="${CHAIN_DATA_PATH_PREFIX}/execution-data" | ||
echo "EXECUTION_DATA_PATH: ${EXECUTION_DATA_PATH}" | ||
|
||
CONSENSUS_DATA_PATH="${CHAIN_DATA_PATH_PREFIX}/consensus-data" | ||
echo "CONSENSUS_DATA_PATH: ${CONSENSUS_DATA_PATH}" | ||
|
||
VALIDATOR_BASE_PATH="${CONSENSUS_DATA_PATH}/validators" | ||
echo "VALIDATOR_BASE_PATH: ${VALIDATOR_BASE_PATH}" | ||
VALIDATOR_KEYS_PATH="${VALIDATOR_BASE_PATH}/keys" | ||
VALIDATOR_SECRETS_PATH="${VALIDATOR_BASE_PATH}/secrets" | ||
|
||
JWT_SECRET_PATH="${GENESIS_PATH}/jwt/jwtsecret" | ||
echo "JWT_SECRET_PATH: ${JWT_SECRET_PATH}" | ||
|
||
VALIDATOR_SOURCE_PATH="${PROJECT_PATH}/testdata/layer2/pos/validator-keys" | ||
|
||
ZETH_LOG_FILE="${PROJECT_PATH}/tmp/zeth.log" | ||
BEACON_LOG_FILE="${PROJECT_PATH}/tmp/beacon.log" | ||
VALIDATOR_LOG_FILE="${PROJECT_PATH}/tmp/validator.log" | ||
|
||
DEFAULT_SETTLEMENT="ethereum" # default settlement layer | ||
DEFAULT_SETTLEMENT_CONFIG_FILE="${PROJECT_PATH}/configs/settlement.toml" | ||
DEFAULT_CUSTOM_NODE_CONFIG_FILE="${PROJECT_PATH}/configs/custom_node_config.toml" | ||
DEFAULT_DATABASE_CONFIG_FILE="${PROJECT_PATH}/configs/database.toml" | ||
|
||
# start the zeth node | ||
PROVER_ADDR=http://localhost:50061 RUST_LOG="debug,evm=trace,consensus::auto=trace,consensus::engine=trace,rpc::eth=trace" nohup eigen-zeth run --database mdbx --database-conf $DEFAULT_DATABASE_CONFIG_FILE --custom-node-conf $DEFAULT_CUSTOM_NODE_CONFIG_FILE --settlement $DEFAULT_SETTLEMENT --settlement-conf $DEFAULT_SETTLEMENT_CONFIG_FILE --chain $CHAIN_SPEC_PATH --datadir $EXECUTION_DATA_PATH --http --http.addr 0.0.0.0 --http.port 48546 --http.api debug,eth,net,trace,web3,rpc --authrpc.jwtsecret $JWT_SECRET_PATH --authrpc.addr 0.0.0.0 --authrpc.port 48552 --port 40304 --full > $ZETH_LOG_FILE 2>&1 & | ||
# start the beacon node | ||
nohup lighthouse bn --debug-level=info --datadir=$CONSENSUS_DATA_PATH --disable-enr-auto-update --enr-address=172.20.0.3 --enr-udp-port=9000 --enr-tcp-port=9000 --listen-address=0.0.0.0 --port=9000 --http --http-address=0.0.0.0 --http-port=4000 --slots-per-restore-point=32 --disable-packet-filter --execution-endpoints=http://localhost:48552 --jwt-secrets=$JWT_SECRET_PATH --suggested-fee-recipient=0x8943545177806ED17B9F23F0a21ee5948eCaa776 --subscribe-all-subnets --enable-private-discovery --testnet-dir=$TESTNET_DIR >> $BEACON_LOG_FILE 2>&1 & | ||
# start the validator client | ||
if [ ! -d "${VALIDATOR_BASE_PATH}" ]; then | ||
mkdir -p ${VALIDATOR_BASE_PATH} | ||
fi | ||
|
||
echo "Copying validator keys and secrets" | ||
cp -rn "${VALIDATOR_SOURCE_PATH}/keys" ${VALIDATOR_BASE_PATH} | ||
cp -rn "${VALIDATOR_SOURCE_PATH}/secrets" ${VALIDATOR_BASE_PATH} | ||
nohup lighthouse vc --debug-level=info --testnet-dir=$TESTNET_DIR --validators-dir=$VALIDATOR_KEYS_PATH --secrets-dir=$VALIDATOR_SECRETS_PATH --init-slashing-protection --beacon-nodes=http://localhost:4000 --suggested-fee-recipient=0x8943545177806ED17B9F23F0a21ee5948eCaa776 >> $VALIDATOR_LOG_FILE 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export PRESET_BASE="mainnet" | ||
export CHAIN_ID="12345" | ||
export DEPOSIT_CONTRACT_ADDRESS="0x4242424242424242424242424242424242424242" | ||
export EL_AND_CL_MNEMONIC="giant issue aisle success illegal bike spike question tent bar rely arctic volcano long crawl hungry vocal artwork sniff fantasy very lucky have athlete" | ||
export CL_EXEC_BLOCK="0" | ||
export SLOT_DURATION_IN_SECONDS=12 | ||
export DEPOSIT_CONTRACT_BLOCK="0x0000000000000000000000000000000000000000000000000000000000000000" | ||
export NUMBER_OF_VALIDATORS=64 | ||
export GENESIS_FORK_VERSION="0x10000038" | ||
export ALTAIR_FORK_VERSION="0x20000038" | ||
export BELLATRIX_FORK_VERSION="0x30000038" | ||
export CAPELLA_FORK_VERSION="0x40000038" | ||
export DENEB_FORK_VERSION="0x50000038" | ||
export DENEB_FORK_EPOCH="0" | ||
export ELECTRA_FORK_VERSION="0x60000038" | ||
export ELECTRA_FORK_EPOCH="100000000" | ||
export EIP7594_FORK_EPOCH="100000001" | ||
export EIP7594_FORK_VERSION="0x70000038" | ||
export WITHDRAWAL_TYPE="0x00" | ||
export WITHDRAWAL_ADDRESS=0xf97e180c050e5Ab072211Ad2C213Eb5AEE4DF134 | ||
export GENESIS_TIMESTAMP=1723253345 | ||
export GENESIS_DELAY=60 | ||
export MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT=8 | ||
export CHURN_LIMIT_QUOTIENT=65536 | ||
export EJECTION_BALANCE=16000000000 | ||
export ETH1_FOLLOW_DISTANCE=2048 | ||
export SHADOW_FORK_FILE= | ||
export MIN_VALIDATOR_WITHDRAWABILITY_DELAY=256 | ||
export SHARD_COMMITTEE_PERIOD=256 | ||
export DATA_COLUMN_SIDECAR_SUBNET_COUNT=32 | ||
export SAMPLES_PER_SLOT=8 | ||
export CUSTODY_REQUIREMENT=1 | ||
export TARGET_NUMBER_OF_PEERS=70 | ||
export ADDITIONAL_PRELOADED_CONTRACTS={} |