From 049bbc03e49802b340933a76795c89c99fba1d7f Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Fri, 10 Aug 2018 12:26:02 +0200 Subject: [PATCH] aleth: fix some remaining snags --- clients/aleth:nightly/Dockerfile | 10 ++++++++++ clients/aleth:nightly/aleth.sh | 12 ++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/clients/aleth:nightly/Dockerfile b/clients/aleth:nightly/Dockerfile index e7ee1d5839..3fe50474cf 100644 --- a/clients/aleth:nightly/Dockerfile +++ b/clients/aleth:nightly/Dockerfile @@ -16,6 +16,16 @@ ADD config.json /config.json ADD aleth.sh /aleth.sh RUN chmod +x /aleth.sh +RUN apk add --no-cache jq bc bash + +# The /version.json is a softlink, which hive won't resolve when trying to read it. +# We copy it into a regular file, and also remove the 'bool' field is_prerelease + + +RUN cat /version.json | jq "del(.is_prerelease)" > /x.json && \ + rm /version.json && \ + mv /x.json /version.json + # Export the usual networking ports to allow outside access to the node EXPOSE 8545 30303 diff --git a/clients/aleth:nightly/aleth.sh b/clients/aleth:nightly/aleth.sh index 268fa0e3e4..06b9cbf09e 100644 --- a/clients/aleth:nightly/aleth.sh +++ b/clients/aleth:nightly/aleth.sh @@ -105,12 +105,12 @@ if [ "$accounts" != "" ]; then chainconfig=`jq -s '.[0] * .[1]' tmp1 tmp2` fi - -if [ "$((16#$HIVE_FORK_METROPOLIS))" -eq "0" ]; then - chainconfig=`echo $chainconfig | jq "delpaths([[\"accounts\", \"0000000000000000000000000000000000000005\", \"code\"]])"` - chainconfig=`echo $chainconfig | jq "delpaths([[\"accounts\", \"0000000000000000000000000000000000000006\", \"code\"]])"` - chainconfig=`echo $chainconfig | jq "delpaths([[\"accounts\", \"0000000000000000000000000000000000000007\", \"code\"]])"` -fi +# For some reason, aleth doesn't like it when precompiles have code/nonce/storage, so we need to remove those fields. +for i in $(seq 1 8); do + chainconfig=`echo $chainconfig | jq "delpaths([[\"accounts\", \"000000000000000000000000000000000000000$i\", \"code\"]])"` + chainconfig=`echo $chainconfig | jq "delpaths([[\"accounts\", \"000000000000000000000000000000000000000$i\", \"nonce\"]])"` + chainconfig=`echo $chainconfig | jq "delpaths([[\"accounts\", \"000000000000000000000000000000000000000$i\", \"storage\"]])"` +done #if [ "$HIVE_TESTNET" == "1" ]; then # chainconfig=`echo $chainconfig | jq "setpath([\"params\", \"accountStartNonce\"]; \"0x0100000\")"`