testnet: don't use -march=native when building the Docker image [skip ci]
(because we run that Docker image both locally and remotely, we can't use the server's "-march" either) - reduce the genesis offset to 5 minutes
This commit is contained in:
parent
5cea471c4b
commit
6007b01d47
|
@ -21,12 +21,13 @@ RUN cd /root \
|
||||||
# to get a fresh up-to-date version of Nim and p2pd.
|
# to get a fresh up-to-date version of Nim and p2pd.
|
||||||
ARG GIT_REVISION
|
ARG GIT_REVISION
|
||||||
ARG NETWORK_NIM_FLAGS
|
ARG NETWORK_NIM_FLAGS
|
||||||
|
ARG MARCH_NIM_FLAGS
|
||||||
|
|
||||||
RUN cd /root/nim-beacon-chain \
|
RUN cd /root/nim-beacon-chain \
|
||||||
&& git fetch \
|
&& git fetch \
|
||||||
&& git reset --hard ${GIT_REVISION} \
|
&& git reset --hard ${GIT_REVISION} \
|
||||||
&& make -j$(nproc) update \
|
&& make -j$(nproc) update \
|
||||||
&& make LOG_LEVEL=TRACE NIMFLAGS="-d:debug -d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS}" beacon_node
|
&& make LOG_LEVEL=TRACE NIMFLAGS="-d:debug -d:insecure -d:testnet_servers_image ${NETWORK_NIM_FLAGS} ${MARCH_NIM_FLAGS}" beacon_node
|
||||||
|
|
||||||
# --------------------------------- #
|
# --------------------------------- #
|
||||||
# Starting new image to reduce size #
|
# Starting new image to reduce size #
|
||||||
|
|
|
@ -5,6 +5,8 @@ SHELL := bash # the shell used internally by "make"
|
||||||
GIT_REVISION ?= $(shell git rev-parse HEAD)
|
GIT_REVISION ?= $(shell git rev-parse HEAD)
|
||||||
NETWORK ?= testnet1
|
NETWORK ?= testnet1
|
||||||
NETWORK_NIM_FLAGS ?= $(shell ../scripts/load-testnet-nim-flags.sh $(NETWORK))
|
NETWORK_NIM_FLAGS ?= $(shell ../scripts/load-testnet-nim-flags.sh $(NETWORK))
|
||||||
|
# Get the required GCC flags by running `gcc -v -E - -march=native </dev/null 2>&1 | grep cc1` on the server.
|
||||||
|
MARCH_NIM_FLAGS ?= -d:disableMarchNative --passC:'-march=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512'
|
||||||
|
|
||||||
IMAGE_TAG ?= $(NETWORK)
|
IMAGE_TAG ?= $(NETWORK)
|
||||||
IMAGE_NAME ?= statusteam/nimbus_beacon_node:$(IMAGE_TAG)
|
IMAGE_NAME ?= statusteam/nimbus_beacon_node:$(IMAGE_TAG)
|
||||||
|
@ -19,6 +21,7 @@ build:
|
||||||
docker build \
|
docker build \
|
||||||
--build-arg="GIT_REVISION=$(GIT_REVISION)" \
|
--build-arg="GIT_REVISION=$(GIT_REVISION)" \
|
||||||
--build-arg="NETWORK_NIM_FLAGS=$(NETWORK_NIM_FLAGS)" \
|
--build-arg="NETWORK_NIM_FLAGS=$(NETWORK_NIM_FLAGS)" \
|
||||||
|
--build-arg="MARCH_NIM_FLAGS=$(MARCH_NIM_FLAGS)" \
|
||||||
-t $(IMAGE_NAME) \
|
-t $(IMAGE_NAME) \
|
||||||
--progress=plain \
|
--progress=plain \
|
||||||
.
|
.
|
||||||
|
|
6
nim.cfg
6
nim.cfg
|
@ -26,7 +26,11 @@
|
||||||
# and larger arithmetic use cases, along with register starvation issues. When
|
# and larger arithmetic use cases, along with register starvation issues. When
|
||||||
# engineering a more portable binary release, this should be tweaked but still
|
# engineering a more portable binary release, this should be tweaked but still
|
||||||
# use at least -msse2 or -msse3.
|
# use at least -msse2 or -msse3.
|
||||||
--passC:"-march=native"
|
@if disableMarchNative:
|
||||||
|
--passC:"-msse3"
|
||||||
|
@else:
|
||||||
|
--passC:"-march=native"
|
||||||
|
@end
|
||||||
|
|
||||||
--threads:on
|
--threads:on
|
||||||
--opt:speed
|
--opt:speed
|
||||||
|
|
|
@ -32,11 +32,10 @@ echo "Beacon node data dir : ${DATA_DIR:="build/testnet-reset-data/$NETWORK"}
|
||||||
echo "Nim build flags : $NETWORK_NIM_FLAGS"
|
echo "Nim build flags : $NETWORK_NIM_FLAGS"
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
read -p "Continue? [yn] " yn
|
read -p "Continue? [Yn] " yn
|
||||||
case $yn in
|
case $yn in
|
||||||
[Yy]* ) break;;
|
* ) break;;
|
||||||
[Nn]* ) exit 1;;
|
[Nn]* ) exit 1;;
|
||||||
* ) echo "Please answer yes or no.";;
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
@ -70,7 +69,8 @@ fi
|
||||||
cd docker
|
cd docker
|
||||||
|
|
||||||
echo "Building Docker image..."
|
echo "Building Docker image..."
|
||||||
make build
|
# we're running this Docker image both locally and on the servers
|
||||||
|
make MARCH_NIM_FLAGS="-d:disableMarchNative" build
|
||||||
|
|
||||||
$DOCKER_BEACON_NODE makeDeposits \
|
$DOCKER_BEACON_NODE makeDeposits \
|
||||||
--quickstart-deposits=$QUICKSTART_VALIDATORS \
|
--quickstart-deposits=$QUICKSTART_VALIDATORS \
|
||||||
|
@ -79,9 +79,8 @@ $DOCKER_BEACON_NODE makeDeposits \
|
||||||
|
|
||||||
TOTAL_VALIDATORS="$(( $QUICKSTART_VALIDATORS + $RANDOM_VALIDATORS ))"
|
TOTAL_VALIDATORS="$(( $QUICKSTART_VALIDATORS + $RANDOM_VALIDATORS ))"
|
||||||
|
|
||||||
$DOCKER_BEACON_NODE \
|
$DOCKER_BEACON_NODE createTestnet \
|
||||||
--data-dir=/data_dir \
|
--data-dir=/data_dir \
|
||||||
createTestnet \
|
|
||||||
--validators-dir=/deposits_dir \
|
--validators-dir=/deposits_dir \
|
||||||
--total-validators=$TOTAL_VALIDATORS \
|
--total-validators=$TOTAL_VALIDATORS \
|
||||||
--last-user-validator=$QUICKSTART_VALIDATORS \
|
--last-user-validator=$QUICKSTART_VALIDATORS \
|
||||||
|
@ -90,7 +89,7 @@ $DOCKER_BEACON_NODE \
|
||||||
--bootstrap-address=$BOOTSTRAP_IP \
|
--bootstrap-address=$BOOTSTRAP_IP \
|
||||||
--bootstrap-port=$BOOTSTRAP_PORT \
|
--bootstrap-port=$BOOTSTRAP_PORT \
|
||||||
$WEB3_URL_ARG $DEPOSIT_CONTRACT_ADDRESS_ARG \
|
$WEB3_URL_ARG $DEPOSIT_CONTRACT_ADDRESS_ARG \
|
||||||
--genesis-offset=900 # Delay in seconds
|
--genesis-offset=300 # Delay in seconds
|
||||||
|
|
||||||
COMMITTED_FILES=" genesis.ssz bootstrap_nodes.txt "
|
COMMITTED_FILES=" genesis.ssz bootstrap_nodes.txt "
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue