-
Notifications
You must be signed in to change notification settings - Fork 226
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
Repair u19 tests in a3p-integration #10947
Conversation
6b1d701
to
f7dfbac
Compare
Deploying agoric-sdk with Cloudflare Pages
|
@turadg, j@dckc, I've added you both as reviewers but it should only take one of you. Do you want to decide which is more available? |
@@ -10,7 +10,7 @@ const vats = { | |||
orchestration: { incarnation: 1 }, | |||
transfer: { incarnation: 2 }, | |||
walletFactory: { incarnation: 6 }, | |||
zoe: { incarnation: 4 }, | |||
zoe: { incarnation: 3 }, |
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.
how did this number go down?
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 know for sure how the test passed with this number. My guess would be that the code last ran in an environment where a Zoe upgrade was included with U18 or the proto U19.
The lower number is correct following U18, and in a U19 that doesn't upgrade Zoe.
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 think because upgrade.go
somehow kept some u18 proposals around when it was rebased on top of u18.
@@ -24,8 +24,6 @@ const sendBankAsset = async powers => { | |||
const valueStr = '{{VALUE}}'; | |||
const value = BigInt(valueStr) | |||
|
|||
console.log(`Start sendBankAsset for ${label}`); |
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.
seems useful but you'd know better since you've been debugging
} from './test-lib/mintHolder-helpers.js'; | ||
import { networkConfig } from './test-lib/index.js'; | ||
|
||
test('mintHolder contract is upgraded', async t => { | ||
test('verify mintHolder contract upgrade', async t => { |
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.
nit: "test" is already a verb
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.
Hmm. I read the string argument as the name of the test, rather than a noun phrase describing what is to be tested. In this case the test used to perform the upgrade (because the proposal was a coreEval), and now only verifies it (because it's now a software upgrade).
"testing/add-USD-OLIVES.js agoricNamesCoreEvals/addUsdOlives", | ||
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo", | ||
"vats/upgrade-mintHolder.js upgrade-mintHolder A3P_INTEGRATION" | ||
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo" |
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.
all these proposals for testing should be under test/
so they don't invalidate the "use" image. see,
Making that change affects .gitignore and .tsconfig but if you put them under a path like test/submissions
then you can use that pathname for those files and not have to manage a list of submissions.
We'll make this easier eventually,
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.
Actually they should be in their core eval output should be in host
, andtest
Something like
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo" | |
"testing/publish-test-info.js test/agoricNamesCoreEvals/publishTestInfo" |
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.
FYI @Chris-Hibbert , the host
thing hasn't landed in a3p. Up to you whether to wait for it to be merged and released to NPM so you can include that synthetic-chain lib version in this PR.
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 like your test/generated
approach. It still copies to the image unnecessarily, but it's only the test image so it doesn't invalid any extra. (If the proposal changes its build would anyway). I think it's better to keep test stuff together than to spread it into another path.
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.
Yeah you're right, a change in the proposal building would likely invalidate everything anyway, but collocating test files together is cleaner.
I got confused about the host
stuff however, I forgot these first argument is relative to the SDK packages.
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 moved the tests to test/
. I was unable to move the test library under test (lint interpreted it as including test code, which is forbidden), so it remains at top-level as n:upgrade-next/test-lib
. The host
stuff seems to be related to agoric-3-proposals
, not script building proposals in agoric-sdk
.
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
host
stuff seems to be related toagoric-3-proposals
, not script building proposals inagoric-sdk
.
Yes sorry I got confused with the host
stuff.
This looks great now
// if variant == "" { | ||
// return nil, nil | ||
// } | ||
func restartFeeDistributorCoreProposal(targetUpgrade string) (vm.CoreProposalStep, error) { |
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'm not reviewing any of the Golang in this PR
packages/builders/scripts/inter-protocol/replace-feeDistributor-combo.js
Outdated
Show resolved
Hide resolved
packages/builders/scripts/inter-protocol/replace-feeDistributor-combo.js
Outdated
Show resolved
Hide resolved
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */ | ||
export default async (homeP, endowments) => { | ||
const { scriptArgs } = endowments; | ||
const variantOrConfig = scriptArgs?.[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.
I'm not familiar with this convention. Please factor it out into a reusable function with documentation.
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.
It's a little unfortunate we have more need for variants. But since that's already the case for the mintHolder I won't block on that.
"testing/add-USD-OLIVES.js agoricNamesCoreEvals/addUsdOlives", | ||
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo", | ||
"vats/upgrade-mintHolder.js upgrade-mintHolder A3P_INTEGRATION" | ||
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo" |
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.
Actually they should be in their core eval output should be in host
, andtest
Something like
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo" | |
"testing/publish-test-info.js test/agoricNamesCoreEvals/publishTestInfo" |
@@ -29,38 +27,19 @@ test.before(async t => { | |||
}; | |||
}); | |||
|
|||
test.serial('simulate trade of IST and USDC', async t => { | |||
test.serial('check stats pre-swap', async t => { |
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 won't block on this, but we've been abusing
test.serial
. Its only guarantee is "not serial" and we've been relying on it being sequential.
You mean "not concurrent". I honestly didn't realize it didn't guarantee sequential.
builderScript, | ||
"defaultProposalBuilder", | ||
map[string]any{ | ||
"variant": variant, |
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.
I've read #10837 and don't understand the path forward.
This distinction is because we want to be able to validate the feeDistributor, and waiting a full hour-long cycle for it seems infeasible. We have other timing-related variations for auctions. In order to get rid of variant configurations for test, we need another solution.
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 think my core question was why these config have to be provided as core proposal argument, and cannot be stored in the config of the contract we're upgrading. That's what #10956 asks. We can punt on it for now.
golang/cosmos/app/upgrade.go
Outdated
// because of #10794, we need to do at least a null upgrade of | ||
// the walletFactory on every software upgrade |
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.
Looks like the comments needs formatting (weird indentation)
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
@@ -10,7 +10,7 @@ const vats = { | |||
orchestration: { incarnation: 1 }, | |||
transfer: { incarnation: 2 }, | |||
walletFactory: { incarnation: 6 }, | |||
zoe: { incarnation: 4 }, | |||
zoe: { incarnation: 3 }, |
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 think because upgrade.go
somehow kept some u18 proposals around when it was rebased on top of u18.
packages/builders/scripts/inter-protocol/replace-feeDistributor-combo.js
Outdated
Show resolved
Hide resolved
import { getManifestForReplaceFeeDistributor } from '@agoric/inter-protocol/src/proposals/replace-fee-distributor.js'; | ||
import { SECONDS_PER_HOUR } from '@agoric/inter-protocol/src/proposals/econ-behaviors.js'; | ||
|
||
const configurations = { |
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.
So I'll bite. Why do these config need to be hard coded in the builder? Can't they be restored from whatever params are currently on the respective chain, removing the need for variants?
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 feeDistributor in a3p-integration
currently has the same parameter settings as on mainNet. We want to run tests that verify that fees are distributed. Without a change, the test would have to wait an hour. We make similar changes with changes to timing for tests for other vats, like auctions.
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.
And we can't update these parameters outside of the core proposal, through a core eval or other governance vote, either before the upgrade, or after in the test?
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.
FeeDistributor is not a governed contract. (!?!) The collectionInterval can only be modified by restarting/upgrading the contract.
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.
Could the contract store the interval in baggage so it can have a value to start from if not in vat params?
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.
Could the contract store the interval in baggage so it can have a value to start from if not in vat params?
It sounds like you're proposing a poor person's fallback to replace governed params. If it's worth making any change here, I'd just make it a governed contract. The contract has no state that we need to preserve.
@@ -62,6 +62,12 @@ export const mintPayment = async (t, address, assetList, value) => { | |||
|
|||
for (const asset of assetList) { | |||
const { label, denom } = asset; | |||
|
|||
// XXX I don't know what asset shows up like this, but let's ignore 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.
please indicate why it's okay to ignore
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 was BLD. I'll filter that out.
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 wasn't BLD, it was testvbankAsset
.
"testing/add-USD-OLIVES.js agoricNamesCoreEvals/addUsdOlives", | ||
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo", | ||
"vats/upgrade-mintHolder.js upgrade-mintHolder A3P_INTEGRATION" | ||
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo" |
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 like your test/generated
approach. It still copies to the image unnecessarily, but it's only the test image so it doesn't invalid any extra. (If the proposal changes its build would anyway). I think it's better to keep test stuff together than to spread it into another path.
f351299
to
d89dde5
Compare
labelList || | ||
Object.values(vbankAssets) | ||
.map(asset => asset.issuerName) | ||
.filter(name => name !== undefined); // testvbankAsset can be malformed. |
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 is idiomatic:
.filter(name => name !== undefined); // testvbankAsset can be malformed. | |
.filter(Boolean); |
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.
thanks.
@mhofman wrote:
I moved the output under |
generated proposals into .../generated
82ab9eb
to
05245ca
Compare
This pull request has been removed from the queue for the following reason: Pull request #10947 has been dequeued. The pull request rule doesn't match anymore. The following conditions don't match anymore:
You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
I started the merge, but then noticed additional comments I hadn't seen before, so I dropped the merge tag. I hope I'll be able to review and address these comments this morning. |
closes: #10901
Description
In clean-up after upgrade-18, the upgrade 19 tests were left in an incomplete state. This ensures they are running again.
Security Considerations
Not a security issue.
Scaling Considerations
No implications.
Documentation Considerations
N/A
Testing and Upgrade Considerations
Our practice is to have
a3p-integration
represent upcoming upgrades to test them in the context of previous upgrades on chain. There were issues getting the U19 tests in proper condition before U18, and so revising them once U18 had been added to the chain was a little wonky. After this PR, The tests demonstrate that U19 will succeed, and the acceptance tests will verify the state of the chain after the upgrade.