From 99a02a41ea0ba9ec7d8d268872cb30b26add87fd Mon Sep 17 00:00:00 2001 From: justinschuldt Date: Wed, 16 Mar 2022 01:36:36 -0500 Subject: [PATCH] fix devnet GS upgrade path commit-id:3a2fa5aa --- node/cmd/guardiand/admintemplate.go | 1 + scripts/test-injection.sh | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/node/cmd/guardiand/admintemplate.go b/node/cmd/guardiand/admintemplate.go index 3858c7a38..0405a7bd0 100644 --- a/node/cmd/guardiand/admintemplate.go +++ b/node/cmd/guardiand/admintemplate.go @@ -38,6 +38,7 @@ func init() { templateGuardianIndex = TemplateCmd.PersistentFlags().Int("idx", 1, "Default current guardian set index") setUpdateNumGuardians = AdminClientGuardianSetTemplateCmd.Flags().Int("num", 1, "Number of devnet guardians in example file") + TemplateCmd.AddCommand(AdminClientGuardianSetTemplateCmd) AdminClientContractUpgradeTemplateCmd.Flags().AddFlagSet(governanceFlagSet) TemplateCmd.AddCommand(AdminClientContractUpgradeTemplateCmd) diff --git a/scripts/test-injection.sh b/scripts/test-injection.sh index 842df65fd..8f60353f8 100755 --- a/scripts/test-injection.sh +++ b/scripts/test-injection.sh @@ -5,14 +5,18 @@ set -e node=$1 idx=$2 -path=/tmp/new-guardianset.prototxt +localPath=./scripts/new-guardianset.prototxt +containerPath=/tmp/new-guardianset.prototxt sock=/tmp/admin.sock -# Create a no-op update that sets the same 1-node guardian set again. -kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand template guardian-set-update --num=1 --idx=${idx} $path +# Create a guardian set update VAA, pipe stdout to a local file. +kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand template guardian-set-update --num=1 --idx=${idx} > ${localPath} -# Verify and print resulting result. The digest incorporates the current time and is NOT deterministic. -kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-verify $path +# Copy the local VAA prototext to a pod's file system. +kubectl cp ${localPath} wormhole/guardian-${node}:${containerPath} -c guardiand + +# Verify the contents of the VAA prototext file and print the result. The digest incorporates the current time and is NOT deterministic. +kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-verify $containerPath # Submit to node -kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-inject --socket $sock $path +kubectl exec -n wormhole guardian-${node} -c guardiand -- /guardiand admin governance-vaa-inject --socket $sock $containerPath