-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R4R: Fix governance simulation, more import/export work #2748
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7031bc8
Update PENDING.md
cwgoes d761eb7
Address remaining comments from #2690
cwgoes f9c7281
Linter fix
cwgoes 241f636
Merge branch 'develop' into cwgoes/fix-gov-sim-more-import-export
cwgoes 183c7b2
use defer
jaekwon 81ae35c
Merge branch 'develop' into cwgoes/fix-gov-sim-more-import-export
cwgoes 2b32268
Correctly set return code
cwgoes d2a5353
Merge branch 'develop' into cwgoes/fix-gov-sim-more-import-export
cwgoes 0e56ed9
Fix DiffKVStore
cwgoes 10713e3
Working on stake import/export
cwgoes 3686a3f
Only apply validator set updates on initial genesis
cwgoes 267728f
Clarify comment
cwgoes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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,54 @@ | ||
#!/bin/bash | ||
|
||
seeds=(1 2 4 7 9 20 32 123 124 582 1893 2989 3012 4728 37827 981928 87821 891823782 989182 89182391 \ | ||
11 22 44 77 99 2020 3232 123123 124124 582582 18931893 29892989 30123012 47284728 37827) | ||
blocks=$1 | ||
|
||
echo "Running multi-seed import-export simulation with seeds ${seeds[@]}" | ||
echo "Running $blocks blocks per seed" | ||
echo "Edit scripts/import-export-sim.sh to add new seeds. Keeping parameters in the file makes failures easy to reproduce." | ||
echo "This script will kill all sub-simulations on SIGINT/SIGTERM (i.e. Ctrl-C)." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🙌ran into this a few times lately |
||
|
||
trap 'kill $(jobs -pr)' SIGINT SIGTERM | ||
|
||
tmpdir=$(mktemp -d) | ||
echo "Using temporary log directory: $tmpdir" | ||
|
||
sim() { | ||
seed=$1 | ||
echo "Running import/export Gaia simulation with seed $seed. This may take awhile!" | ||
file="$tmpdir/gaia-simulation-seed-$seed-date-$(date -Iseconds -u).stdout" | ||
echo "Writing stdout to $file..." | ||
go test ./cmd/gaia/app -run TestGaiaImportExport -SimulationEnabled=true -SimulationNumBlocks=$blocks \ | ||
-SimulationBlockSize=200 -SimulationCommit=true -SimulationSeed=$seed -v -timeout 24h > $file | ||
} | ||
|
||
i=0 | ||
pids=() | ||
for seed in ${seeds[@]}; do | ||
sim $seed & | ||
pids[${i}]=$! | ||
i=$(($i+1)) | ||
sleep 10 # start in order, nicer logs | ||
done | ||
|
||
echo "Simulation processes spawned, waiting for completion..." | ||
|
||
code=0 | ||
|
||
i=0 | ||
for pid in ${pids[*]}; do | ||
wait $pid | ||
last=$? | ||
seed=${seeds[${i}]} | ||
if [ $last -ne 0 ] | ||
then | ||
echo "Import/export simulation with seed $seed failed!" | ||
code=1 | ||
else | ||
echo "Import/export simulation with seed $seed OK" | ||
fi | ||
i=$(($i+1)) | ||
done | ||
|
||
exit $code |
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
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
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
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
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THANK YOU!