-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swing-store export data outside of genesis file (#9549)
Closes #9567 ## Description Stores the swing-store export data outside of the genesis file, and only include a hash of it in genesis for validation. This is the bulk of the data in the genesis file (on mainnet 6GB vs 300MB for the rest), and it serves little purpose to keep it in there. Furthermore golevelDB chokes when cosmos attempts to store the genesis file inside the DB (limit of 4GB documents) ### Security Considerations None, the data remains validated ### Scaling Considerations Reduces memory usage on genesis export / import. Furthermore we avoid iterating over the data twice on import, which is painfully slow for IAVL. ### Documentation Considerations None ### Testing Considerations Added a3p acceptance test Manually tested as follow: ``` cd packages/cosmic-swingset make scenario2-setup make scenario2-run-chain # wait until there are blocks, then kill mkdir t1/n0/export agd --home t1/n0 export --export-dir t1/n0/export agd --home t1/n0 tendermint unsafe-reset-all mv t1/n0/export/* t1/n0/config make scenario2-run-chain # verify blocks are being produced after genesis restart ``` ### Upgrade Considerations There is a compatibility mode to load genesis files with export data embedded.
- Loading branch information
Showing
7 changed files
with
246 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
source /usr/src/upgrade-test-scripts/env_setup.sh | ||
|
||
export_genesis() { | ||
GENESIS_EXPORT_DIR="$1" | ||
shift | ||
GENESIS_HEIGHT_ARG= | ||
|
||
if [ -n "$1" ]; then | ||
GENESIS_HEIGHT_ARG="--height $1" | ||
shift | ||
fi | ||
|
||
agd export --export-dir "$GENESIS_EXPORT_DIR" $GENESIS_HEIGHT_ARG "$@" | ||
} | ||
|
||
killAgd | ||
FORK_TEST_DIR="$(mktemp -t -d fork-test-XXX)" | ||
mkdir -p "$FORK_TEST_DIR/config" | ||
cp /root/.agoric/config/priv_validator_key.json "$FORK_TEST_DIR/config" | ||
agd --home "$FORK_TEST_DIR" tendermint unsafe-reset-all | ||
|
||
export_genesis "$FORK_TEST_DIR/config" | ||
startAgd --home "$FORK_TEST_DIR" |
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 |
---|---|---|
|
@@ -13,3 +13,4 @@ yarn ava ./*.test.js | |
./create-kread-item-test.sh | ||
|
||
./state-sync-snapshots-test.sh | ||
./genesis-test.sh |
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
Oops, something went wrong.