validate mainnet specs against all forks (#11625)

* ethcore/res: move test specifications in test-specs subdirectory

* ethcore/spec: update paths for test machines

* scripts/actions: validate mainnet specs against all forks

* fix unexpected end of macro invocation

* scripts/actions: remove first empty line

Co-Authored-By: Niklas Adolfsson <niklasadolfsson1@gmail.com>

Co-authored-by: Niklas Adolfsson <niklasadolfsson1@gmail.com>
This commit is contained in:
Raw Pong Ghmoa
2020-04-15 12:15:04 +02:00
committed by GitHub
parent 4b5e9ddfa6
commit 2a3b321a34
17 changed files with 77 additions and 50 deletions

View File

@@ -1,27 +1,37 @@
#!/bin/bash
set -e # fail on any error
set -u # treat unset variables as error
echo "________Running validate_chainspecs.sh________"
echo -e "*** Running \`validate_chainspecs.sh\`"
ERR=0
echo "________Validate chainspecs________"
time cargo build --release -p chainspec --verbose --color=always
echo -e "\n*** Validating custom chain specifications:"
for spec in ethcore/res/*.json; do
if ! ./target/release/chainspec "$spec"; then ERR=1; fi
done
echo -e "\n*** Validating test-chain specifications:"
for spec in ethcore/res/ethereum/test-specs/*.json; do
if ! ./target/release/chainspec "$spec"; then ERR=1; fi
done
echo -e "\n*** Validating ethereum chain specifications:"
for spec in ethcore/res/ethereum/*.json; do
if ! ./target/release/chainspec "$spec"; then ERR=1; fi
done
echo "________Mainnet contains Istanbul EIPs________"
for eip in $(grep --only-matching "eip.*Transition" ethcore/res/ethereum/istanbul_test.json); do
if ! grep -q $eip ethcore/res/ethereum/foundation.json; then
echo "ERROR: $eip is missing in the foundation json spec"
ERR=1
fi
echo -e "\n*** Checking mainnet EIPs against test specifications:"
for spec in "ethcore/res/ethereum/foundation.json" "ethcore/res/ethereum/classic.json"; do
for fork in "frontier" "homestead" "byzantium" "constantinople" "st_peters" "istanbul"; do
for eip in $(grep --only-matching "eip.*Transition" ethcore/res/ethereum/test-specs/${fork}_test.json); do
if ! grep -q $eip $spec; then
echo "ERROR: $fork $eip is missing in the $spec"
ERR=1
else
echo "$spec contains $fork $eip"
fi
done
done
done
exit $ERR