mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-13 13:55:45 +00:00
3d3831dde8
* avoid costly hike memory allocations for operations that don't need to re-traverse it * avoid unnecessary state checks (which might trigger unwanted state root computations) * disable optimize-for-hits due to the MPT no longer being complete at all times
35 lines
742 B
Bash
Executable File
35 lines
742 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Create a set of states, each advanced by 100k blocks
|
|
|
|
set -e
|
|
|
|
trap "exit" INT
|
|
|
|
if [ -z "$3" ]
|
|
then
|
|
echo "Syntax: make_states.sh datadir era1dir statsdir [startdir]"
|
|
exit 1;
|
|
fi
|
|
|
|
counter=0
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
DATE="$(date -u +%Y%m%d_%H%M)"
|
|
REV=$(git rev-parse --short=8 HEAD)
|
|
DATA_DIR="$1/${DATE}-${REV}"
|
|
|
|
mkdir -p "$DATA_DIR"
|
|
[ "$4" ] && cp -ar "$4"/* "$DATA_DIR"
|
|
|
|
while true;
|
|
do
|
|
"$SCRIPT_DIR/../build/nimbus" import \
|
|
--data-dir:"${DATA_DIR}" \
|
|
--era1-dir:"$2" \
|
|
--debug-csv-stats:"$3/stats-${DATE}-${REV}.csv" \
|
|
--max-blocks:100000
|
|
cp -ar "$1/${DATE}-${REV}" "$1/${DATE}-${REV}"-$(printf "%04d" $counter)
|
|
counter=$((counter+1))
|
|
done
|