-
Notifications
You must be signed in to change notification settings - Fork 214
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
feat: save the outgoing EC Charter instance and kit #10749
Conversation
41ebc93
to
1bccc25
Compare
Deploying agoric-sdk with Cloudflare Pages
|
1bccc25
to
07869f8
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.
I'm not positive I understand the motivation / context; you may want more eyes.
a few suggestions to consider...
}); | ||
|
||
const label = 'econCommitteeCharter'; | ||
const previousCharterKit = { label, ...econCharterKit }; |
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 reads as if any label in econCharterKit
overrides the one on line 335.
const previousCharterKit = { label, ...econCharterKit }; | |
const previousCharterKit = { ...econCharterKit, 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.
In some ways I prefer the other order. We need to add this because the label wasn't added initially, not because we want to change it. If this proposal is re-used, there's no reason to change an existing label.
But I'll change it.
* PromiseSpaceOf<{ retiredContractInstances: MapStore<string, Instance> }>} powers | ||
* - The resources and capabilities required to start the committee. |
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 wonder if/when retiredContractInstances
should be added in vats/src
/core/types-ambient.d.ts
|
||
trace('Starting new EC Charter Instance'); | ||
|
||
const terms = await harden({ |
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.
Spurious await
?
const terms = await harden({ | |
const terms = harden({ |
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.
dropped
const previousCharterKit = { label, ...econCharterKit }; | ||
|
||
const boardID = await E(board).getId(previousCharterKit.instance); | ||
const identifier = `${label}-${boardID}`; |
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.
are we relying on this identifier syntax somewhere? It seems like there should be helper functions to construct and parse it. perhaps near provideRetiredInstances
?
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 far there's no plan for code to rely on it. People may construct scripts to make use of it (like Richard's vat killer), but the boardID has to be looked up manually at this point to know what name to make.
const charterIDs = Array.from(retiredContractInstances.keys()).filter(k => | ||
k.startsWith('econCommitteeCharter'), | ||
); | ||
assert(charterIDs); |
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.
log it/them? I'd feel better seeing positive evidence in a ci log.
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
@@ -36,6 +36,12 @@ export const testRecordedRetiredInstances = async ({ | |||
const committeeInstance = retiredContractInstances.get(committeeIDs[0]); | |||
assert(await E(contractKits).get(committeeInstance)); | |||
|
|||
const charterIDs = Array.from(retiredContractInstances.keys()).filter(k => |
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 used to seeing...
const charterIDs = Array.from(retiredContractInstances.keys()).filter(k => | |
const charterIDs = [...retiredContractInstances.keys()].filter(k => |
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.
yeah, looks good to me
previousInstanceP, | ||
contractKitsP, | ||
econCharterKitP, | ||
provideRetiredInstances(retiredContractInstancesP, produceRetiredInstances), |
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.
still slightly weirded out by our approach for this, but it looks sound
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.
in case it makes you feel any better, the approach goes back to the vaults release.
agoric-sdk/packages/inter-protocol/src/proposals/econ-behaviors.js
Lines 471 to 475 in ba3b776
// Initialize the periodic collectors list if we don't have one. | |
periodicFeeCollectorsP.resolve( | |
makeScalarBigMapStore('periodicCollectors', { durable: true }), | |
); | |
const periodicCollectors = await periodicFeeCollectors; |
or even further (mid 2022) using []
:
agoric-sdk/packages/run-protocol/src/proposals/econ-behaviors.js
Lines 681 to 683 in b5d9869
// Initialize the periodic collectors list if we don't have one. | |
periodicFeeCollectorsP.resolve([]); | |
const periodicCollectors = await periodicFeeCollectors; |
7a093c6
to
355a2e1
Compare
refs: #10680
Description
Add the EconomicCommittee Charter to the instances and kits being saved.
Security Considerations
Don't throw away stuff you might need.
Scaling Considerations
Negligible
Documentation Considerations
None
Testing Considerations
Added a test to see that the charterID was saved.
Upgrade Considerations
If U18 and U19 get combined, this will impact the contracts being updated in U18. If we only pull some changes from U19 into U18, this should be inclduded.