-
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.
Support for
snapshots export
command (#9563)
closes: #9100 closes: #9425 ## Description Until we have better layering of the snapshots extensions in cosmos-sdk, this replaces the implementation of the `snapshots export` command to initiate the snapshot creation through our front-running mechanism used for state-sync. Drive-by cleanup of the root command as well to address #9425 ### Security Considerations None, ### Scaling Considerations None ### Documentation Considerations Communicate to validators that we fixed the command and that it's usable as expected with any cosmos chain. ### Testing Considerations Added an integration test since this only modifies the command line handling Manually tested with the following ``` cd packages/cosmic-swingset make scenario2-setup make scenario2-run-chain # wait until there are blocks, then kill agd --home t1/n0 snapshots export rm -rf t1/n0/data/application.db t1/n0/data/agoric # the above removes app state without removing cometbft state as that cannot # be restored easily in a single node chain agd --home t1/n0 snapshot restore $snapshot_height 2 make scenario2-run-chain # verify blocks are being produced ``` ### Upgrade Considerations Since we replace the upstream sdk command handling, any future changes upstream would have to be reflected in the override.
- Loading branch information
Showing
6 changed files
with
149 additions
and
47 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
a3p-integration/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch
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,13 @@ | ||
diff --git a/dist/upgrade-test-scripts/env_setup.sh b/dist/upgrade-test-scripts/env_setup.sh | ||
index 617a0fbe7efdfa457e28fc52806dba1b323930d8..25f52a6cf133dca830bd0dcd47c91700e6a8effe 100755 | ||
--- a/dist/upgrade-test-scripts/env_setup.sh | ||
+++ b/dist/upgrade-test-scripts/env_setup.sh | ||
@@ -100,7 +100,7 @@ killAgd() { | ||
AGD_PID=$(cat $HOME/.agoric/agd.pid) | ||
kill $AGD_PID | ||
rm $HOME/.agoric/agd.pid | ||
- wait $AGD_PID || true | ||
+ tail --pid=$AGD_PID -f /dev/null || true | ||
} | ||
|
||
provisionSmartWallet() { |
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 |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
"doctor": "yarn synthetic-chain doctor" | ||
}, | ||
"dependencies": { | ||
"@agoric/synthetic-chain": "^0.1.0", | ||
"@agoric/synthetic-chain": "patch:@agoric/synthetic-chain@npm%3A0.1.0#~/.yarn/patches/@agoric-synthetic-chain-npm-0.1.0-148de716a6.patch", | ||
"@types/better-sqlite3": "^7.6.9" | ||
}, | ||
"packageManager": "[email protected]", | ||
|
14 changes: 14 additions & 0 deletions
14
a3p-integration/proposals/z:acceptance/state-sync-snapshots-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
source /usr/src/upgrade-test-scripts/env_setup.sh | ||
|
||
set -e | ||
|
||
killAgd | ||
agd snapshots export | ||
SNAPSHOT_DETAILS=$(agd snapshots list | head -n1 | sed -E 's/height: ([0-9]+) format: ([0-9]+) chunks: [0-9]+/\1 \2/') | ||
echo found snapshot $SNAPSHOT_DETAILS | ||
rm -rf /root/.agoric/data/application.db /root/.agoric/data/agoric | ||
agd snapshots restore $SNAPSHOT_DETAILS | ||
|
||
startAgd |
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 |
---|---|---|
|
@@ -11,3 +11,5 @@ GLOBIGNORE=initial.test.js | |
yarn ava ./*.test.js | ||
|
||
./create-kread-item-test.sh | ||
|
||
./state-sync-snapshots-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