-
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
Builder Script for Replacing Committee and Charter #10161
Changes from all commits
fff596d
ee927b8
05d2cf7
a038d6e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { makeHelpers } from '@agoric/deploy-script-support'; | ||
import { getManifestForReplaceCommitteeAndCharter } from '@agoric/inter-protocol/src/proposals/replaceCommitteeAndCharter.js'; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async ({ publishRef, install }, opts) => { | ||
return harden({ | ||
sourceSpec: | ||
'@agoric/inter-protocol/src/proposals/replaceCommitteeAndCharter.js', | ||
getManifestCall: [ | ||
getManifestForReplaceCommitteeAndCharter.name, | ||
{ | ||
...opts, | ||
economicCommitteeRef: publishRef( | ||
install( | ||
'@agoric/governance/src/committee.js', | ||
'../bundles/bundle-committee.js', | ||
), | ||
), | ||
economicCharterRef: publishRef( | ||
install( | ||
'@agoric/inter-protocol/src/econCommitteeCharter.js', | ||
'../bundles/bundle-econCommitteeCharter.js', | ||
), | ||
), | ||
}, | ||
], | ||
}); | ||
}; | ||
|
||
export default async (homeP, endowments) => { | ||
const { writeCoreEval } = await makeHelpers(homeP, endowments); | ||
await writeCoreEval('replace-committee-and-charter', defaultProposalBuilder); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
/* global E */ | ||
// @ts-check | ||
/// <reference types="@agoric/vats/src/core/core-eval-env"/> | ||
/// <reference types="@agoric/vats/src/core/types-ambient"/> | ||
import { E } from '@endo/eventual-send'; | ||
const { Fail } = assert; | ||
|
||
const runConfig = { | ||
committeeName: 'Economic Committee', | ||
economicCommitteeAddresses: { | ||
gov1: 'agoric1ldmtatp24qlllgxmrsjzcpe20fvlkp448zcuce', | ||
gov1: 'agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q', | ||
// gov2: 'agoric140dmkrz2e42ergjj7gyvejhzmjzurvqeq82ang', | ||
// gov3: 'agoric1w8wktaur4zf8qmmtn3n7x3r0jhsjkjntcm3u6h', | ||
// gov4: 'agoric1p2aqakv3ulz4qfy2nut86j9gx0dx0yw09h96md', | ||
|
@@ -83,7 +81,7 @@ | |
console.info('confirmed deposit for', debugName); | ||
}; | ||
|
||
const handlehighPrioritySendersList = async ({ | ||
consume: { highPrioritySendersManager: highPrioritySendersManagerP }, | ||
}) => { | ||
const EC_HIGH_PRIORITY_SENDERS_NAMESPACE = 'economicCommittee'; | ||
|
@@ -111,14 +109,14 @@ | |
|
||
if (highPrioritySendersManager) { | ||
// Add the addresses | ||
for (let address of uniqueAddAddresses) { | ||
for (const address of uniqueAddAddresses) { | ||
await E(highPrioritySendersManager).add( | ||
EC_HIGH_PRIORITY_SENDERS_NAMESPACE, | ||
address, | ||
); | ||
} | ||
// Remove the addresses | ||
for (let address of uniqueRemoveAddresses) { | ||
for (const address of uniqueRemoveAddresses) { | ||
await E(highPrioritySendersManager).remove( | ||
EC_HIGH_PRIORITY_SENDERS_NAMESPACE, | ||
address, | ||
|
@@ -324,7 +322,7 @@ | |
); | ||
}; | ||
|
||
const shutdown = async ({ | ||
consume: { economicCommitteeCreatorFacet, econCharterKit }, | ||
}) => { | ||
trace('Shutting down old EC Committee'); | ||
|
@@ -337,12 +335,12 @@ | |
trace('EC Charter shutdown successful'); | ||
}; | ||
|
||
const main = async permittedPowers => { | ||
await shutdown(permittedPowers); | ||
export const replaceCommitteeAndCharter = async permittedPowers => { | ||
// await shutdown(permittedPowers); | ||
await startNewEconomicCommittee(permittedPowers); | ||
await startNewEconCharter(permittedPowers); | ||
await addGovernorsToEconCharter(permittedPowers); | ||
await handlehighPrioritySendersList(permittedPowers); | ||
// await handlehighPrioritySendersList(permittedPowers); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Commented line 338. Because the Commented 343 too. Although it's not required if I've updated the wallet addresses on line 5 in |
||
const psmKitMap = await permittedPowers.consume.psmKit; | ||
|
||
|
@@ -377,4 +375,53 @@ | |
trace('Installed New Economic Committee'); | ||
}; | ||
|
||
main; | ||
harden(replaceCommitteeAndCharter); | ||
export const getManifestForReplaceCommitteeAndCharter = async ({ | ||
economicCommitteeRef: _economicCommitteeRef, | ||
economicCharterRef: _economicCharterRef, | ||
}) => ({ | ||
manifest: { | ||
[replaceCommitteeAndCharter.name]: { | ||
consume: { | ||
board: true, | ||
chainStorage: true, | ||
econCharterKit: true, | ||
economicCommitteeCreatorFacet: true, | ||
highPrioritySendersManager: true, | ||
instancePrivateArgs: true, | ||
namesByAddressAdmin: true, | ||
priceAuthority: true, | ||
priceAuthorityAdmin: true, | ||
reserveKit: true, | ||
vaultFactoryKit: true, | ||
auctioneerKit: true, | ||
psmKit: true, | ||
zoe: true, | ||
}, | ||
produce: { | ||
economicCommittee: true, | ||
economicCommitteeCreatorFacet: true, | ||
econCharterKit: true, | ||
econCommitteeCharter: true, | ||
}, | ||
installation: { | ||
consume: { | ||
committee: true, | ||
econCommitteeCharter: true, | ||
binaryVoteCounter: true, | ||
}, | ||
}, | ||
instance: { | ||
consume: { | ||
reserve: true, | ||
VaultFactory: true, | ||
auctioneer: true, | ||
}, | ||
produce: { | ||
economicCommittee: true, | ||
econCommitteeCharter: 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.
Having developed the builder script by referencing other examples in our repo, I have some questions around:
economicCommitteeRef
andeconomicCharterRef
? Specifically, what are these references used for in the script?install
function, what does the second parameter represent? Is it indicating the directory where the bundles are located, or does it serve another purpose?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.
Is this section of code responsible for generating new bundles? If yes, I reckon we don't need to include:
That's something we plan to do in 2 different core evals(Maybe I'll add that in #10151 and #10150) which updates the
creatorFacet
of committee and charter contracts with the relevant methods after our design for it is finalized.