-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from input-output-hk/bwbush/peras-iosim
Statistical analysis of block production and statistics-aware quickcheck
- Loading branch information
Showing
7 changed files
with
1,747 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#/usr/bin/env bash | ||
|
||
PERAS_IOSIM=../../../dist-newstyle/build/x86_64-linux/ghc-9.6.3/peras-iosim-0.1.0.0/x/peras-iosim/noopt/build/peras-iosim/peras-iosim | ||
|
||
cat << EOI > tmp-results.csv | ||
Seed,Active Slot Coefficient,End Slot,Total Stake,Node Stake,Blocks Produced | ||
EOI | ||
|
||
for i in {1..1000} | ||
do | ||
|
||
SEED=$RANDOM | ||
TOTAL_STAKE=1000 | ||
END_SLOT=7200 | ||
ASC=0.05 | ||
|
||
cat << EOI > tmp-network.yaml | ||
randomSeed: $SEED | ||
peerCount: 1 | ||
downstreamCount: 0 | ||
totalStake: $TOTAL_STAKE | ||
maximumStake: $TOTAL_STAKE | ||
messageDelay: 0.35 | ||
endSlot: $END_SLOT | ||
EOI | ||
|
||
cat << EOI > tmp-protocol.yaml | ||
protocol: PseudoPraos | ||
activeSlotCoefficient: $ASC | ||
EOI | ||
|
||
echo "$i: $SEED" | ||
|
||
"$PERAS_IOSIM" --parameter-file tmp-network.yaml --protocol-file tmp-protocol.yaml --result-file tmp-result.json | ||
|
||
jq -r '.exitStates.N1 | "'"$SEED","$ASC","$END_SLOT","$TOTAL_STAKE"',\(.stake),\(.preferredChain.blocks|length)"' tmp-result.json >> tmp-results.csv | ||
|
||
done | ||
|
||
sort -ur tmp-results.csv > results.csv |
Oops, something went wrong.