Skip to content

Commit

Permalink
use fast runtime, default fast mode
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden authored and claravanstaden committed Jan 21, 2024
1 parent b1943d0 commit 7b606dc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 32 deletions.
23 changes: 11 additions & 12 deletions web/packages/test/scripts/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,26 @@ build_relayer() {
cp $relay_bin "$output_bin_dir"
}

hack_beacon_client() {
set_slot_time() {
local new_value=$1
echo "Hack lodestar for faster slot time"
local preset_minimal_config_file="$root_dir/lodestar/packages/config/src/chainConfig/presets/mainnet.ts"
local preset_mainnet_config_file="$root_dir/lodestar/packages/config/src/chainConfig/presets/mainnet.ts"
if [[ "$(uname)" == "Darwin" && -z "${IN_NIX_SHELL:-}" ]]; then
gsed -i "s/SECONDS_PER_SLOT: 6/SECONDS_PER_SLOT: 1/g" $preset_minimal_config_file
gsed -i "s/SECONDS_PER_SLOT: .*/SECONDS_PER_SLOT: $new_value,/g" $preset_mainnet_config_file
else
sed -i "s/SECONDS_PER_SLOT: 6/SECONDS_PER_SLOT: 1/g" $preset_minimal_config_file
sed -i "s/SECONDS_PER_SLOT: .*/SECONDS_PER_SLOT: $new_value,/g" $preset_mainnet_config_file
fi
}

build_lodestar() {
if [ ! -d "$root_dir/lodestar/packages/cli/lib" ]; then
pushd $root_dir/lodestar
if [ "$eth_fast_mode" == "true" ]; then
hack_beacon_client
fi
yarn install && yarn run build
popd
pushd $root_dir/lodestar
if [ "$eth_fast_mode" == "true" ]; then
set_slot_time 1
else
echo "lodestar has already been built."
set_slot_time 12
fi
yarn install && yarn run build
popd
}

install_binary() {
Expand Down
19 changes: 0 additions & 19 deletions web/packages/test/scripts/deploy-ethereum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,6 @@ start_lodestar() {
fi
}

set_slot_time() {
local new_value=$1
echo "Hack lodestar for faster slot time"
local preset_mainnet_config_file="$root_dir/lodestar/packages/config/src/chainConfig/presets/mainnet.ts"
if [[ "$(uname)" == "Darwin" && -z "${IN_NIX_SHELL:-}" ]]; then
gsed -i "s/SECONDS_PER_SLOT: .*/SECONDS_PER_SLOT: $new_value,/g" $preset_mainnet_config_file
else
sed -i "s/SECONDS_PER_SLOT: .*/SECONDS_PER_SLOT: $new_value,/g" $preset_mainnet_config_file
fi
}

deploy_local() {
# 1. deploy execution client
echo "Starting execution node"
Expand All @@ -98,14 +87,6 @@ deploy_local() {
echo "Waiting for geth API to be ready"
sleep 3

# if were are running locally speed up the seconds per slot from 12 seconds to 2 seconds. if we are not
# running locally, revert
if [ "$eth_network" == "localhost" ]; then
set_slot_time 1
else
set_slot_time 12
fi

# 2. deploy consensus client
echo "Starting beacon node"
start_lodestar
Expand Down
2 changes: 1 addition & 1 deletion web/packages/test/scripts/set-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ eth_endpoint_http="${ETH_RPC_ENDPOINT:-http://127.0.0.1:8545}/${INFURA_PROJECT_I
eth_endpoint_ws="${ETH_WS_ENDPOINT:-ws://127.0.0.1:8546}/${INFURA_PROJECT_ID:-}"
eth_gas_limit="${ETH_GAS_LIMIT:-5000000}"
eth_chain_id="${ETH_NETWORK_ID:-15}"
eth_fast_mode="${ETH_FAST_MODE:-false}"
eth_fast_mode="${ETH_FAST_MODE:-true}"
etherscan_api_key="${ETHERSCAN_API_KEY:-}"

parachain_relay_eth_key="${PARACHAIN_RELAY_ETH_KEY:-0x8013383de6e5a891e7754ae1ef5a21e7661f1fe67cd47ca8ebf4acd6de66879a}"
Expand Down

0 comments on commit 7b606dc

Please sign in to comment.