-
Notifications
You must be signed in to change notification settings - Fork 212
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(a3p): create a3p test for replace electorate core eval #10241
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
ffce1a7
to
aef84d0
Compare
a3p-integration/proposals/b:replace-electorate/replaceElectorate.test.js
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,5 @@ | |||
export const waitUntil = async waitTime => { |
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.
export const waitUntil = async waitTime => { | |
export const waitUntil = async (waitTime, { setTimeout = globalThis.setTimeout, now = Date.now } = {}) => { |
see
-1, | ||
fromCapData, | ||
); | ||
await waitUntil(latestQuestion.closingRule.deadline); |
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.
await waitUntil(latestQuestion.closingRule.deadline); | |
const { setTimeout } = globalThis; | |
const { now } = Date; | |
await waitUntil(latestQuestion.closingRule.deadline, { setTimeout, now }); |
@@ -0,0 +1,5 @@ | |||
export const waitUntil = async waitTime => { | |||
while (Math.floor(Date.now() / 1000) < waitTime) { |
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.
while (Math.floor(Date.now() / 1000) < waitTime) { | |
while (Math.floor(now() / 1000) < waitTime) { |
6a3afcb
to
78581b1
Compare
5082910
to
519de18
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.
Lots of good stuff here. But the EC changes should take place as part of n:upgrade-next
; see #10258 .
The z:acceptance
stuff could probably land as its own PR. I would expect it to work before or after the change of membership. Hm... maybe that would complicate things.
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 several parts that I don't understand.
await agops.ec( | ||
'charter', | ||
'--send-from', | ||
GOV1ADDR, |
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.
only gov1? Won't we need the others to accept theirs too?
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 config for A3P_INTEGRATION seems to have only one member in the committee. hence only one call to accept the invitation
agoric-sdk/packages/builders/scripts/inter-protocol/replace-electorate-core.js
Lines 70 to 72 in 919c173
voterAddresses: { | |
gov1: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q', | |
}, |
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.
odd. ok.
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.
packages/synthetic-chain/src/lib/constants.js
has GOV1ADDR
, GOV2ADDR
, and GOV3ADDR
.
packages/builders/scripts/inter-protocol/updatePriceFeeds.js
has all three.
Where did you find a short list?
a3p-integration/proposals/n:upgrade-next/replaceElectorate.test.js
Outdated
Show resolved
Hide resolved
a3p-integration/proposals/n:upgrade-next/replaceElectorate.test.js
Outdated
Show resolved
Hide resolved
export const governanceDriver = await makeGovernanceDriver( | ||
fetch, | ||
networkConfig, | ||
); |
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.
Injecting fetch
and networkConfig
should be left to test scripts and not in a module like this.
see OCap Discipline
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.
updated.
also isnt the walletUtils
object in this file breaking this principle?
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.
yes.
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 is waitUntil
, for that matter.
const config = configurations[variant]; | ||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => { | ||
const config = configurations[opts.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.
ah! I missed this earlier. Now I get 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.
This looks like it addresses the critical stuff. Good work!
I leave updating walletUtils
and waitUntil
to your discretion.
I'd like to wait to review till @dckc's requested changes are in. Please ping me at that point. |
@Chris-Hibbert all requested changes from @dckc are done |
await agops.ec( | ||
'charter', | ||
'--send-from', | ||
GOV1ADDR, |
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.
packages/synthetic-chain/src/lib/constants.js
has GOV1ADDR
, GOV2ADDR
, and GOV3ADDR
.
packages/builders/scripts/inter-protocol/updatePriceFeeds.js
has all three.
Where did you find a short list?
getLastUpdate(address, { readLatestHead }), | ||
), | ||
); | ||
voteUpdates.forEach(voteUpdate => { |
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.
Lint flags this with Prefer for...of instead of Array.forEach. Is there any reason to prefer forEach
here?
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.
not particularly, just missed it. updating
golang/cosmos/app/upgrade.go
Outdated
var variant string | ||
|
||
switch validUpgradeName(upgradeName) { | ||
case "UNRELEASED_A3P_INTEGRATION": | ||
variant = "A3P_INTEGRATION" | ||
case "UNRELEASED_main": | ||
variant = "MAINNET" | ||
case "UNRELEASED_devnet": | ||
variant = "DEVNET" | ||
// Noupgrade for this version. | ||
case "UNRELEASED_BASIC": | ||
} | ||
variantJson, err := json.Marshal(variant) | ||
if err != nil { | ||
return nil, err | ||
} | ||
var result strings.Builder | ||
err = t.Execute(&result, map[string]any{ | ||
"variantJson": string(variantJson), | ||
}) | ||
if err != nil { | ||
return nil, err | ||
} | ||
jsonStr := result.String() | ||
jsonBz := []byte(jsonStr) | ||
if !json.Valid(jsonBz) { | ||
return nil, fmt.Errorf("invalid JSON: %s", jsonStr) | ||
} | ||
proposal := vm.ArbitraryCoreProposal{Json: jsonBz} | ||
return vm.CoreProposalStepForModules(proposal), nil |
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 going to need to do all of this for the priceFeed upgrade. Can it be defined so it can be shared rather than requiring me to copy 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.
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.
Thanks! I build on top of this for #10317
@Chris-Hibbert new A3P_INTEGRATION committee only has one member agoric-sdk/packages/builders/scripts/inter-protocol/replace-electorate-core.js Lines 70 to 72 in 919c173
|
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.
a3p config needs gov4
const config = configurations[variant]; | ||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => { | ||
const config = configurations[opts.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.
Let's be sure to add gov4 in the a3p configuration.
for (const address of governanceAddresses) { | ||
/** @type {any} */ | ||
const voteWallet = await readLatestHead( | ||
`published.wallet.${GOV1ADDR}.current`, |
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.
`published.wallet.${GOV1ADDR}.current`, | |
`published.wallet.${address}.current`, |
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.
presuming that the emerynet deployment uses the UNRELEASED_devnet
config, this looks great!
56f8b3c
to
f406d25
Compare
closes: #10138
closes: #10185
closes: #10258
Description
A3P tests for the replace electorate core eval. also adds the replace-electorate-core.js script to upgrade.go since it will now be a part of the chain halting upgrade
new tests are as follows:
n:replace-electorate
which tests for acceptance of new invitationsz:acceptance
Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Upgrade Considerations