From a926685cfe08efdef78aa1681e07e8b7436e6a40 Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Mon, 11 Dec 2023 09:28:52 -0800 Subject: [PATCH 1/2] ci: defer Loadgen compatibility --- .github/workflows/integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9710fa138eb..557c483770e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -130,7 +130,8 @@ jobs: path: ./agoric-sdk - uses: ./agoric-sdk/.github/actions/restore-node with: - node-version: 18.x + # XXX loadgen not compatible with 18.19 https://github.com/Agoric/agoric-sdk/pull/8365#issuecomment-1848003597 + node-version: 18.18 path: ./agoric-sdk # Forces xsnap to initialize all memory to random data, which increases # the chances the content of snapshots may deviate between validators From f0654e0ea84e94316bbdca2fe55cc5bb6f57752d Mon Sep 17 00:00:00 2001 From: Turadg Aleahmad Date: Tue, 12 Dec 2023 08:29:28 -0800 Subject: [PATCH 2/2] feat: guard ContractGovernorKit --- .../governance/src/contractGovernorKit.js | 47 +++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/packages/governance/src/contractGovernorKit.js b/packages/governance/src/contractGovernorKit.js index 1f5f5d900d3..14cc3d79911 100644 --- a/packages/governance/src/contractGovernorKit.js +++ b/packages/governance/src/contractGovernorKit.js @@ -1,16 +1,57 @@ import { Fail } from '@agoric/assert'; -import { makeTracer } from '@agoric/internal'; -import { prepareExoClassKit } from '@agoric/vat-data'; +import { UnguardedHelperI, makeTracer } from '@agoric/internal'; +import { M, prepareExoClassKit } from '@agoric/vat-data'; import { E } from '@endo/eventual-send'; +import { + InvitationShape, + InstanceHandleShape, + InstallationShape, +} from '@agoric/zoe/src/typeGuards.js'; +import { TimestampShape } from '@agoric/time'; import { setupApiGovernance } from './contractGovernance/governApi.js'; import { setupFilterGovernance } from './contractGovernance/governFilter.js'; import { CONTRACT_ELECTORATE, setupParamGovernance, } from './contractGovernance/governParam.js'; +import { ClosingRuleShape, ParamChangesSpecShape } from './typeGuards.js'; const trace = makeTracer('CGK', false); +const ContractGovernorKitI = { + helper: UnguardedHelperI, + creator: M.interface('Contract Governor Kit creator', { + replaceElectorate: M.call(InvitationShape).returns(M.promise()), + voteOnParamChanges: M.call( + InstallationShape, + TimestampShape, + ParamChangesSpecShape, + ).returns(M.promise()), + voteOnApiInvocation: M.call( + M.string(), + M.arrayOf(M.any()), + InstallationShape, + TimestampShape, + ).returns(M.promise()), + voteOnOfferFilter: M.call( + InstallationShape, + TimestampShape, + M.arrayOf(M.string()), + ).returns(M.promise()), + getCreatorFacet: M.call().returns(M.remotable('ElectorateCreator')), + getAdminFacet: M.call().returns(M.remotable('ElectorateAdmin')), + getInstance: M.call().returns(InstanceHandleShape), + getPublicFacet: M.call().returns(M.remotable('ElectoratePublic')), + }), + public: M.interface('Contract Governor Kit public', { + getElectorate: M.call().returns(M.promise(/* Instance */)), + getGovernedContract: M.call().returns(InstanceHandleShape), + validateVoteCounter: M.call(InstanceHandleShape).returns(M.promise()), + validateElectorate: M.call(InstanceHandleShape).returns(M.promise()), + validateTimer: M.call(ClosingRuleShape).returns(), + }), +}; + /** * * @param {import('@agoric/vat-data').Baggage} baggage @@ -36,7 +77,7 @@ export const prepareContractGovernorKit = (baggage, powers) => { const makeContractGovernorKit = prepareExoClassKit( baggage, 'ContractGovernorKit', - undefined, + ContractGovernorKitI, /** * @param {import('@agoric/zoe/src/zoeService/utils.js').StartedInstanceKit} startedInstanceKit * @param {LimitedCF} limitedCreatorFacet