-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Record instances that will be replaced so we can manage them (#10680)
closes: #10669 ## Description Record instances of contracts that will be replaced so we can find them later and be able to manage them. ### Security Considerations We've lost the handle to some vats before, and it's a hassle. ### Scaling Considerations The problem gets worse as we upgrade more vats. ### Documentation Considerations None. ### Testing Considerations Verified that Auctions and Committee are present. The priceFeeds vary too much across test environments to be worth checking. ### Upgrade Considerations Yes..
- Loading branch information
Showing
12 changed files
with
201 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
restart-valueVow | ||
start-valueVow | ||
localchaintest-submission | ||
recorded-instances-submission |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
a3p-integration/proposals/z:acceptance/recorded-retired.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import test from 'ava'; | ||
|
||
import { evalBundles } from '@agoric/synthetic-chain'; | ||
|
||
const SUBMISSION_DIR = 'recorded-instances-submission'; | ||
|
||
test(`recorded instances in u18`, async t => { | ||
const result = await evalBundles(SUBMISSION_DIR); | ||
console.log('recorded retired instance result:', result); | ||
t.pass('checked names'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
packages/builders/scripts/testing/recorded-retired-instances.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { makeTracer } from '@agoric/internal'; | ||
import { E } from '@endo/far'; | ||
|
||
const trace = makeTracer('RecordedRetired', true); | ||
|
||
/** | ||
* @param {BootstrapPowers & | ||
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance>; | ||
* }> | ||
* } powers | ||
*/ | ||
export const testRecordedRetiredInstances = async ({ | ||
consume: { | ||
contractKits, | ||
// governedContractKits, | ||
retiredContractInstances: retiredContractInstancesP, | ||
}, | ||
}) => { | ||
trace('Start'); | ||
const retiredContractInstances = await retiredContractInstancesP; | ||
|
||
const auctionIDs = Array.from(retiredContractInstances.keys()).filter(k => | ||
k.startsWith('auction'), | ||
); | ||
assert(auctionIDs); | ||
assert(auctionIDs.length === 1); | ||
const auctionInstance = retiredContractInstances.get(auctionIDs[0]); | ||
trace({ auctionInstance }); | ||
// I don't know why it's neither in governedContractKits nor contractKits | ||
// assert(await E(governedContractKits).get(auctionInstance)); | ||
|
||
const committeeIDs = Array.from(retiredContractInstances.keys()).filter(k => | ||
k.startsWith('economicCommittee'), | ||
); | ||
assert(committeeIDs); | ||
assert(committeeIDs.length === 1); | ||
const committeeInstance = retiredContractInstances.get(committeeIDs[0]); | ||
assert(await E(contractKits).get(committeeInstance)); | ||
|
||
trace('done'); | ||
}; | ||
harden(testRecordedRetiredInstances); | ||
|
||
export const getManifestForRecordedRetiredInstances = () => { | ||
return { | ||
manifest: { | ||
[testRecordedRetiredInstances.name]: { | ||
consume: { | ||
contractKits: true, | ||
// governedContractKits: true, | ||
retiredContractInstances: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */ | ||
export const defaultProposalBuilder = async () => | ||
harden({ | ||
sourceSpec: | ||
'@agoric/builders/scripts/testing/recorded-retired-instances.js', | ||
getManifestCall: ['getManifestForRecordedRetiredInstances', {}], | ||
}); | ||
|
||
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */ | ||
export default async (homeP, endowments) => { | ||
// import dynamically so the module can work in CoreEval environment | ||
const dspModule = await import('@agoric/deploy-script-support'); | ||
const { makeHelpers } = dspModule; | ||
const { writeCoreEval } = await makeHelpers(homeP, endowments); | ||
await writeCoreEval('recorded-retired', defaultProposalBuilder); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.