-
Notifications
You must be signed in to change notification settings - Fork 207
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
test: a docker test for the zoe/zcf upgrade #8018
Conversation
bb381af
to
5e1e4bd
Compare
ee9a305
to
891ee25
Compare
606ad23
to
1e6d52e
Compare
891ee25
to
66cd691
Compare
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.
didn't finish my review today, but I'll share my thoughts so far
yarn.lock
Outdated
@@ -2831,6 +2831,14 @@ better-sqlite3@^8.2.0: | |||
bindings "^1.5.0" | |||
prebuild-install "^7.1.0" | |||
|
|||
better-sqlite3@^8.4.0: |
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.
isn't better-sqlite3 already in our yarn.lock? Are we introducing another version of it or something?
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.
reverting.
|
||
|
||
echo XXXX install bundles XXXXXX | ||
for f in $here/zoe-full-upgrade/*bundle.json; do |
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.
I see this PR adds the bundles generated from the current git version. I can see why we might need to check in bundles from some older git version, but for the current version, I think we can do:
yarn bundle-source --cache-json /tmp packages/vats/src/vat-zoe.js Zoe-upgrade
ZOE_HASH=`jq -r .endoZipBase64Sha512 /tmp/bundle-Zoe-upgrade.json`
yarn bundle-source --cache-json /tmp packages/zoe/src/contractFacet/vatRoot.js Zcf-upgrade
ZCF_HASH=`jq -r .endoZipBase64Sha512 /tmp/bundle-Zcf-upgrade.json`
and then assert that $ZOE_HASH
matches the one from zcf-upgrade-script.js
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.
These bundles were actually (and crucially) generated in #7966 (effectively, a newer version), which has the changes to Zoe and ZCF. This PR sits on top of a branch without those changes, so we can't build them here.
I guess you're right that I could rebase this branch on top of #7966, and build the way you describe. deployment/upgrade-test
provides an immutable environment that isn't affected by the checked-out code under agoric-sdk.
What #7969 wants to do can only be done in a branch that doesn't contain the Zoe/ZCF changes, but this branch's goals don't require that isolation.
// import { E } from "@endo/far"; | ||
|
||
const ZCF_BUNDLE_ID = | ||
'b1-8674abc9a8de561c4a33fb475b87be75708cd901c37931fd5ac1f40d3ee99937a459a6ca7b4a8b7907512626caf98c125f22c15384826e37dfc899dc0bf2a63a'; |
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.
I get c4b3d8bf11cfbcc90ced7e1a8a936d368098360bb01aa4c70a750a39f56dc9d87c10547e825585ce11ceeca5b24d7093bdef04843ac8ac6e90e661b1235bf69b
when I do:
yarn bundle-source --cache-json /tmp packages/zoe/src/contractFacet/vatRoot.js Zcf-upgrade
export ZCF_HASH=`jq -r .endoZipBase64Sha512 /tmp/bundle-Zcf-upgrade.json`
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.
It's not a surprise that they don't match what you get when you build here, since this branch doesn't have the Zoe/ZCF changes. But I'll rebase to a place that does as you suggested above, and we can make that work.
I was also presuming there might be changes to libraries, etc. that would effect the hash, and expected to do a final re-build before submitting the merge request.
packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/actions.sh
Show resolved
Hide resolved
66cd691
to
39150df
Compare
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.
There are instructions in agoric-upgrade-11/actions.sh for building the bundles.
packages/deployment/upgrade-test/upgrade-test-scripts/agoric-upgrade-11/actions.sh
Show resolved
Hide resolved
|
||
|
||
echo XXXX install bundles XXXXXX | ||
for f in $here/zoe-full-upgrade/*bundle.json; do |
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.
These bundles were actually (and crucially) generated in #7966 (effectively, a newer version), which has the changes to Zoe and ZCF. This PR sits on top of a branch without those changes, so we can't build them here.
I guess you're right that I could rebase this branch on top of #7966, and build the way you describe. deployment/upgrade-test
provides an immutable environment that isn't affected by the checked-out code under agoric-sdk.
What #7969 wants to do can only be done in a branch that doesn't contain the Zoe/ZCF changes, but this branch's goals don't require that isolation.
// import { E } from "@endo/far"; | ||
|
||
const ZCF_BUNDLE_ID = | ||
'b1-8674abc9a8de561c4a33fb475b87be75708cd901c37931fd5ac1f40d3ee99937a459a6ca7b4a8b7907512626caf98c125f22c15384826e37dfc899dc0bf2a63a'; |
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.
It's not a surprise that they don't match what you get when you build here, since this branch doesn't have the Zoe/ZCF changes. But I'll rebase to a place that does as you suggested above, and we can make that work.
I was also presuming there might be changes to libraries, etc. that would effect the hash, and expected to do a final re-build before submitting the merge request.
yarn.lock
Outdated
@@ -2831,6 +2831,14 @@ better-sqlite3@^8.2.0: | |||
bindings "^1.5.0" | |||
prebuild-install "^7.1.0" | |||
|
|||
better-sqlite3@^8.4.0: |
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.
reverting.
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.
Excellent. Thanks for the thorough comments
@@ -5,5 +5,55 @@ | |||
# CWD is agoric-sdk | |||
here=./upgrade-test-scripts/agoric-upgrade-11 | |||
|
|||
# run zoe thru "null upgrade" | |||
$here/zoe-upgrade/zoe-upgrade-driver.sh | |||
# Pre-steps: |
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.
helpful docs
# Finish | ||
# * create instance of prober contract and run expecting to see atomicRearrange | ||
|
||
echo XXXX fill wallet XXXXXX |
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.
XXX elsewhere means tech debt. please user a different character. Or just upcase.
echo XXXX fill wallet XXXXXX | |
echo FILL WALLET |
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.
done
@@ -5,5 +5,55 @@ | |||
# CWD is agoric-sdk | |||
here=./upgrade-test-scripts/agoric-upgrade-11 |
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.
this precedes this PR, but I want to say I think we can have a better name for this. eg. thisupgrade
. or find a way to evaluate the scripts letting them use file path relative references. maybe if we adopt zx or execa.
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.
done
@@ -0,0 +1,95 @@ | |||
// to turn on ts-check: |
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.
??? did you mean to use @ts-check
?
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.
|
||
console.info('running zcf prober'); | ||
|
||
const sub = (a, v) => { |
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.
what happens if you import AmountMath?
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.
AIUI, imports aren't supported in core-eval proposals.
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.
We have a mechanism to support imports
. You used it in #7969: packages/vats/src/proposals/zcf-proposal.js
starts with import { E } from '@endo/far';
.
But it's a complex mechanism, and E
is in the environment of a core-eval script even without that import. I tend to do a certain amount of copy-and-paste before I go for the whole writeCoreProposal
thing.
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.
I tend to do a certain amount of copy-and-paste before I go for the whole writeCoreProposal thing.
@dckc I'm not positive how to interpret this. Should I change something here?
}; | ||
|
||
/* | ||
* Test a full upgrade of Zzoe and ZCF. |
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.
💤
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.
Took me a couple of passes to see it. Thx.
set -euo pipefail | ||
|
||
# This shows how to upgrade Zoe and ZCF on a running chain. It presumes that | ||
# The bundles for Zoe and ZCF have been installed, and their hashes updated in |
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.
# The bundles for Zoe and ZCF have been installed, and their hashes updated in | |
# the bundles for Zoe and ZCF have been installed, and their hashes updated in |
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.
yup
# zcf-upgrade-script.js. The bundles can be generated by running the test in | ||
# vats/test/bootstrapTests/test-zcf-upgrade.js, noting the logged ZOE BUNDLE ID | ||
# and ZCF BUNDLE ID, and finding the corresponding bundles in ~/.agoric/cache. | ||
# !! THERE HAS TO BE A BETTER WAY !! |
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.
there will be! we just have to design and implement it :)
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.
There are slightly clearer instructions now in actions.sh.
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.
I haven't been able to reproduce the bundles.
I'd like to avoid checking them in at all.
/* global E */ | ||
|
||
// import { E } from "@endo/far"; | ||
// to turn on ts-check: |
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.
I don't get it. Why disable ts-check if this is all it takes to enable it? Oh, does the import
fail at runtime? if that's it then please enable ts-check and do a type-only import.
/** @typedef {import('@endo/far').E} E */
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.
@dckc I'm just cargo-culting here. What's your advice on best practices?
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.
type-only import
TIL. Nifty.
But at runtime, the string import(
cannot occur anywhere in the script, even in comments. See rejectImportExpressions
Conservatively reject the source text if it may contain a dynamic
import expression. To reject without parsing,rejectImportExpressions
will
also reject some other text as well.
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.
oh... this import(
limitation is another thing that's addressed by the "cadillac method", using writeCoreProposal
from @agoric/deploy-script-support
:
export const defangEvaluableCode = code => |
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.
by way of documentation, I started...
Let's pair to come up with a working alternative. |
1ce7f19
to
bd043a9
Compare
63009af
to
a5a339e
Compare
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.
The blank check in zcf-upgrade-permit.json
is worth filling in.
@@ -0,0 +1 @@ | |||
true |
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.
That's a blank check for zcf-upgrade-permit.json
to use all powers in the bootstrap space. We neglected to go back and fill in the actual amount. Based on what upgradeZoeAndZcf
uses from its argument, that seems to be:
true | |
{ | |
"consume": { "vatStore": true, "vatAdminSvc": true } | |
} |
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.
done
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.
4b6a7cb
to
18c0640
Compare
6bea479
to
5813535
Compare
756c8e5
to
9eb583a
Compare
chore: generate upgrade bundles and check hashes
9eb583a
to
1261732
Compare
test: a docker test for the zoe/zcf upgrade
refs: #6678
Description
This is a Docker test to validate that the upgrade will work correctly on chain, and to build the necessary scripts.
Security Considerations
This is about deployment.
Scaling Considerations
N/A
Documentation Considerations
N/A
Testing Considerations
This is a test.