Skip to content

Commit

Permalink
fix(xsnap): agd checks 'xsnap -n' for agoric-upgrade-10
Browse files Browse the repository at this point in the history
This is a quick hack to assert that xsnap has been recompiled
recently. `bin/agd` now runs `xsnap -n` to get the "network upgrade
version", and asserts that it matches an expected value of
`agoric-update-10`. If a user has somehow failed to recompile `xsnap`,
their old copy won't understand the `-n` command, and `agd` will fail,
rather than running a stale version (with highly confusing results).

refs #7012
  • Loading branch information
warner committed May 24, 2023
1 parent 99de101 commit 5265726
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions bin/agd
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ if $BUILD_ONLY; then
exit 0
fi

# the xsnap binary lives in a platform-specific directory
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) platform=lin;;
Darwin*) platform=mac;;
*) platform=win;;
esac
# check the xsnap version against our baked-in notion of what version we should be using
xsnap_version=$("${thisdir}/../packages/xsnap/xsnap-native/xsnap/build/bin/${platform}/release/xsnap-worker" -n)
[[ "${xsnap_version}" == "agoric-upgrade-10" ]] || fatal "xsnap out of date"

# Run the built Cosmos daemon.
# shellcheck disable=SC2031
export PATH="$thisdir/../packages/cosmic-swingset/bin:$PATH"
Expand Down
2 changes: 1 addition & 1 deletion packages/xsnap/build.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MODDABLE_URL=https://github.com/agoric-labs/moddable.git
MODDABLE_COMMIT_HASH=46bbad5b8aa746c50b5f97aee1b1f235ab2a5903
XSNAP_NATIVE_URL=https://github.com/agoric-labs/xsnap-pub
XSNAP_NATIVE_COMMIT_HASH=25abead6b762b49faee840aed5c544556112711a
XSNAP_NATIVE_COMMIT_HASH=2d8ccb76b8508e490d9e03972bb4c64f402d5135
2 changes: 1 addition & 1 deletion packages/xsnap/xsnap-native

0 comments on commit 5265726

Please sign in to comment.