Skip to content

Commit

Permalink
Merge 9e19162 into bf53f5e
Browse files Browse the repository at this point in the history
  • Loading branch information
sirasistant authored Oct 31, 2024
2 parents bf53f5e + 9e19162 commit 0947ff8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions noir-projects/noir-protocol-circuits/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,26 @@ esac
# This value may be too low.
# If vk generation fail with an amount of free memory greater than this value then it should be increased.
MIN_PARALLEL_VK_GENERATION_MEMORY=500000000
PARALLEL_VK=${PARALLEL_VK:-true}
PARALLEL_VK=${PARALLEL_VK:-false}

if [[ AVAILABLE_MEMORY -gt MIN_PARALLEL_VK_GENERATION_MEMORY ]] && [[ $PARALLEL_VK == "true" ]]; then
echo "Generating vks in parallel..."
for pathname in "./target"/*.json; do
BB_HASH=$BB_HASH node ../scripts/generate_vk_json.js "$pathname" "./target/keys" &
if [[ $pathname != *"_simulated"* ]]; then
BB_HASH=$BB_HASH node ../scripts/generate_vk_json.js "$pathname" "./target/keys" &
fi
done

for job in $(jobs -p); do
wait $job || exit 1
done

else
echo "System does not have enough memory for parallel vk generation, falling back to sequential"
echo "Generating VKs sequentially..."

for pathname in "./target"/*.json; do
if [[ $pathname != *"_simulated"* ]]; then
BB_HASH=$BB_HASH node ../scripts/generate_vk_json.js "$pathname" "./target/keys"
fi
done
fi

0 comments on commit 0947ff8

Please sign in to comment.