Skip to content

Commit da7f4d1

Browse files
authored
Merge pull request #251 from Agoric/mk/add-u20
feat: add agoric-upgrade-20 (proposal 95)
2 parents 05bde38 + 4ac1867 commit da7f4d1

20 files changed

+8249
-0
lines changed

proposals/95:upgrade-20/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test/generated/
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
diff --git a/dist/node/axios.cjs b/dist/node/axios.cjs
2+
index db4997bee1aa48aca215c6b2e7443292c94c086f..fb39f7e0046c66b1c0275c1a82ed49d3cc7cff83 100644
3+
--- a/dist/node/axios.cjs
4+
+++ b/dist/node/axios.cjs
5+
@@ -371,9 +371,18 @@ function merge(/* obj1, obj2, obj3, ... */) {
6+
const extend = (a, b, thisArg, {allOwnKeys}= {}) => {
7+
forEach(b, (val, key) => {
8+
if (thisArg && isFunction(val)) {
9+
- a[key] = bind(val, thisArg);
10+
- } else {
11+
+ val = bind(val, thisArg);
12+
+ }
13+
+ const oldDesc = Object.getOwnPropertyDescriptor(a, key);
14+
+ if (oldDesc) {
15+
a[key] = val;
16+
+ } else {
17+
+ Object.defineProperty(a, key, {
18+
+ value: val,
19+
+ writable: true,
20+
+ enumerable: true,
21+
+ configurable: true
22+
+ });
23+
}
24+
}, {allOwnKeys});
25+
return a;
26+
@@ -404,7 +413,9 @@ const stripBOM = (content) => {
27+
*/
28+
const inherits = (constructor, superConstructor, props, descriptors) => {
29+
constructor.prototype = Object.create(superConstructor.prototype, descriptors);
30+
- constructor.prototype.constructor = constructor;
31+
+ Object.defineProperty(constructor.prototype, 'constructor', {
32+
+ value: constructor
33+
+ });
34+
Object.defineProperty(constructor, 'super', {
35+
value: superConstructor.prototype
36+
});
37+
@@ -566,7 +577,7 @@ const isRegExp = kindOfTest('RegExp');
38+
39+
const reduceDescriptors = (obj, reducer) => {
40+
const descriptors = Object.getOwnPropertyDescriptors(obj);
41+
- const reducedDescriptors = {};
42+
+ const reducedDescriptors = Object.create(null);
43+
44+
forEach(descriptors, (descriptor, name) => {
45+
let ret;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
diff --git a/src/util/minimal.js b/src/util/minimal.js
2+
index 3c406dee753b5c6fb29dda2e64d4482e754e7873..564e5dadaa50e4ad05fc18b767ee276c99e9f0f9 100644
3+
--- a/src/util/minimal.js
4+
+++ b/src/util/minimal.js
5+
@@ -280,7 +280,30 @@ function newError(name) {
6+
merge(this, properties);
7+
}
8+
9+
- (CustomError.prototype = Object.create(Error.prototype)).constructor = CustomError;
10+
+ CustomError.prototype = Object.create(Error.prototype, {
11+
+ constructor: {
12+
+ value: CustomError,
13+
+ writable: true,
14+
+ enumerable: false,
15+
+ configurable: true,
16+
+ },
17+
+ name: {
18+
+ get() { return name; },
19+
+ set: undefined,
20+
+ enumerable: false,
21+
+ // configurable: false would accurately preserve the behavior of
22+
+ // the original, but I'm guessing that was not intentional.
23+
+ // For an actual error subclass, this property would
24+
+ // be configurable.
25+
+ configurable: true,
26+
+ },
27+
+ toString: {
28+
+ value() { return this.name + ": " + this.message; },
29+
+ writable: true,
30+
+ enumerable: false,
31+
+ configurable: true,
32+
+ },
33+
+ });
34+
35+
Object.defineProperty(CustomError.prototype, "name", { get: function() { return name; } });
36+

proposals/95:upgrade-20/.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

proposals/95:upgrade-20/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Proposal to upgrade the chain software
2+
3+
This reflects agoric-upgrade-20, which was adopted on mainnet by [governance
4+
proposal 95](https://ping.pub/agoric/gov/95) at block height 19830777 and
5+
block time 2025-05-27T20:19:12.776104201Z.

proposals/95:upgrade-20/package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"agoricProposal": {
3+
"releaseNotes": "https://github.com/Agoric/agoric-sdk/releases/tag/agoric-upgrade-20",
4+
"sdkImageTag": "62",
5+
"planName": "agoric-upgrade-20",
6+
"upgradeInfo": {
7+
"binaries": {
8+
"any": "https://github.com/Agoric/agoric-sdk/archive/8e4207fa19dabf76c1f91f8779b5b5b93570ecea.zip//agoric-sdk-8e4207fa19dabf76c1f91f8779b5b5b93570ecea?checksum=sha256:0f3856b751f8081c14f3615e9310849449ed654238135d70899af6c283213e38"
9+
},
10+
"source": "https://github.com/Agoric/agoric-sdk/archive/8e4207fa19dabf76c1f91f8779b5b5b93570ecea.zip?checksum=sha256:0f3856b751f8081c14f3615e9310849449ed654238135d70899af6c283213e38"
11+
},
12+
"type": "Software Upgrade Proposal"
13+
},
14+
"type": "module",
15+
"license": "Apache-2.0",
16+
"dependencies": {
17+
"@agoric/client-utils": "dev",
18+
"@agoric/ertp": "dev",
19+
"@agoric/internal": "dev",
20+
"@agoric/synthetic-chain": "^0.5.6",
21+
"@agoric/zoe": "dev",
22+
"@endo/errors": "^1.2.10",
23+
"@endo/init": "^1.1.9",
24+
"@endo/marshal": "^1.6.4",
25+
"agoric": "dev",
26+
"ava": "^5.3.1",
27+
"better-sqlite3": "^9.6.0",
28+
"execa": "9.1.0"
29+
},
30+
"ava": {
31+
"concurrency": 1,
32+
"timeout": "2m",
33+
"files": [
34+
"!submission"
35+
]
36+
},
37+
"scripts": {
38+
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
39+
},
40+
"packageManager": "[email protected]",
41+
"devDependencies": {
42+
"eslint": "^8.57.0",
43+
"npm-run-all": "^4.1.5",
44+
"typescript": "^5.6.3"
45+
},
46+
"resolutions": {
47+
"protobufjs@npm:^6.8.8": "patch:protobufjs@npm%3A6.11.4#~/.yarn/patches/protobufjs-npm-6.11.4-af11968b80.patch",
48+
"axios@npm:^1.6.0": "patch:axios@npm%3A1.7.7#~/.yarn/patches/axios-npm-1.7.7-cfbedc233d.patch"
49+
}
50+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/* eslint-env node */
2+
import { retryUntilCondition } from '@agoric/client-utils';
3+
import {
4+
addUser,
5+
CHAINID,
6+
makeAgd,
7+
VALIDATORADDR,
8+
} from '@agoric/synthetic-chain';
9+
import { execFileSync } from 'node:child_process';
10+
11+
const agd = makeAgd({ execFileSync }).withOpts({ keyringBackend: 'test' });
12+
13+
/**
14+
* @param {string} addr
15+
* @param {string} wanted
16+
* @param {string} [from]
17+
*/
18+
export const bankSend = (addr, wanted, from = VALIDATORADDR) => {
19+
return agd.tx(['bank', 'send', from, addr, wanted], {
20+
chainId: CHAINID,
21+
from,
22+
yes: true,
23+
});
24+
};
25+
26+
export const provision = (name, address) =>
27+
agd.tx(['swingset', 'provision-one', name, address, 'SMART_WALLET'], {
28+
chainId: 'agoriclocal',
29+
from: 'validator',
30+
yes: true,
31+
});
32+
33+
export const introduceAndProvision = async name => {
34+
const address = await addUser(name);
35+
console.log('ADDR', name, address);
36+
37+
const provisionP = provision(name, address);
38+
39+
return { provisionP, address };
40+
};
41+
42+
/**
43+
* @param {import('@agoric/client-utils').VstorageKit} vstorageKit
44+
*/
45+
export const getProvisionedAddresses = async vstorageKit => {
46+
const children = await vstorageKit.vstorage.keys('published.wallet');
47+
return children;
48+
};
49+
50+
export const checkUserProvisioned = (addr, vstorageKit) =>
51+
retryUntilCondition(
52+
() => getProvisionedAddresses(vstorageKit),
53+
children => children.includes(addr),
54+
'Account not provisioned',
55+
{ maxRetries: 5, retryIntervalMs: 1000, log: console.log, setTimeout },
56+
);

proposals/95:upgrade-20/test.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
# segregate so changing these does not invalidate the proposal image
6+
# à la https://github.com/Agoric/agoric-3-proposals/pull/213
7+
cd test
8+
9+
GLOBIGNORE=initial.test.js
10+
yarn ava initial.test.js
11+
12+
yarn ava *.test.js
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"consume": {
3+
"contractKits": true,
4+
"namesByAddressAdmin": true,
5+
"agoricNames": true
6+
}
7+
}
8+
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// @ts-nocheck
2+
/* eslint-disable no-undef */
3+
const PROVISIONING_POOL_ADDR = 'agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346';
4+
5+
const depositUsdLemons = async powers => {
6+
const {
7+
consume: {
8+
contractKits: contractKitsP,
9+
namesByAddressAdmin: namesByAddressAdminP,
10+
agoricNames,
11+
},
12+
} = powers;
13+
14+
const namesByAddressAdmin = await namesByAddressAdminP;
15+
16+
const getDepositFacet = async address => {
17+
const hub = E(E(namesByAddressAdmin).lookupAdmin(address)).readonly();
18+
return E(hub).lookup('depositFacet');
19+
};
20+
21+
const [contractKits, usdLemonsIssuer, usdLemonsBrand, ppDepositFacet] =
22+
await Promise.all([
23+
contractKitsP,
24+
E(agoricNames).lookup('issuer', 'USD_LEMONS'),
25+
E(agoricNames).lookup('brand', 'USD_LEMONS'),
26+
getDepositFacet(PROVISIONING_POOL_ADDR),
27+
]);
28+
29+
console.log('[CONTRACT_KITS]', contractKits);
30+
console.log('[ISSUER]', usdLemonsIssuer);
31+
32+
let usdLemonsMint;
33+
for (const { publicFacet, creatorFacet: mint } of contractKits.values()) {
34+
if (publicFacet === usdLemonsIssuer) {
35+
usdLemonsMint = mint;
36+
console.log('BINGO', mint);
37+
break;
38+
}
39+
}
40+
41+
console.log('Minting USD_LEMONS');
42+
const helloPayment = await E(usdLemonsMint).mintPayment(
43+
harden({ brand: usdLemonsBrand, value: 500000n }),
44+
);
45+
46+
console.log('Funding provision pool...');
47+
await E(ppDepositFacet).receive(helloPayment);
48+
49+
console.log('Done.');
50+
};
51+
52+
depositUsdLemons;
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"vatParameters": {
3+
"chainStorageEntries": true
4+
},
5+
"consume": {
6+
"agoricNamesAdmin": "makeCoreProposalBehavior",
7+
"bankManager": "bank",
8+
"startUpgradable": true,
9+
"anchorBalancePayments": true,
10+
"anchorKits": true,
11+
"board": true,
12+
"chainStorage": true,
13+
"diagnostics": true,
14+
"zoe": "zoe",
15+
"feeMintAccess": "zoe",
16+
"economicCommitteeCreatorFacet": "economicCommittee",
17+
"provisionPoolStartResult": true,
18+
"econCharterKit": "econCommitteeCharter",
19+
"chainTimerService": "timer",
20+
"psmKit": true,
21+
"vatAdminSvc": "makeCoreProposalBehavior"
22+
},
23+
"installation": {
24+
"consume": {
25+
"mintHolder": "zoe",
26+
"contractGovernor": "zoe",
27+
"psm": "zoe"
28+
},
29+
"produce": "makeCoreProposalBehavior"
30+
},
31+
"produce": {
32+
"testFirstAnchorKit": true,
33+
"anchorBalancePayments": true,
34+
"anchorKits": true,
35+
"psmKit": "true"
36+
},
37+
"instance": {
38+
"consume": {
39+
"economicCommittee": "economicCommittee"
40+
}
41+
},
42+
"brand": {
43+
"consume": {
44+
"IST": "zoe"
45+
}
46+
},
47+
"evaluateBundleCap": "makeCoreProposalBehavior",
48+
"modules": {
49+
"utils": {
50+
"runModuleBehaviors": "makeCoreProposalBehavior"
51+
}
52+
}
53+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"name": "add-LEMONS-PSM",
3+
"script": "add-LEMONS-PSM.js",
4+
"permit": "add-LEMONS-PSM-permit.json",
5+
"bundles": [
6+
{
7+
"entrypoint": "@agoric/inter-protocol/src/psm/psm.js",
8+
"bundleID": "b1-4f44cd63f1753681a61105348391aaf6e0b763e9e1e9079ea6200cec1ccfb1dc183ddf84037235a8696d33181bf179b1337658e068c933ce84ceaaedaa611151",
9+
"fileName": "/Users/mujahid/.agoric/cache/b1-4f44cd63f1753681a61105348391aaf6e0b763e9e1e9079ea6200cec1ccfb1dc183ddf84037235a8696d33181bf179b1337658e068c933ce84ceaaedaa611151.json"
10+
},
11+
{
12+
"entrypoint": "@agoric/vats/src/mintHolder.js",
13+
"bundleID": "b1-e46459201fd48d8495a60c83b21aabe1d7759adaafc15c0955a80e123a91b86747352f7130d98fb77d2f542f9db4ee5f0635771d7aea9b3f84290d4ed34fc93e",
14+
"fileName": "/Users/mujahid/.agoric/cache/b1-e46459201fd48d8495a60c83b21aabe1d7759adaafc15c0955a80e123a91b86747352f7130d98fb77d2f542f9db4ee5f0635771d7aea9b3f84290d4ed34fc93e.json"
15+
},
16+
{
17+
"entrypoint": "@agoric/inter-protocol/src/proposals/startPSM.js",
18+
"bundleID": "b1-5bf4f602df7453c68e9ba7504af0bd97e5ba34f0a1a5acc5f12aa3454d6de13fd1b60ead41c021597ebd98c1417059ac8235a2ac6336fcf7a8fd4b66d095d8f7",
19+
"fileName": "/Users/mujahid/.agoric/cache/b1-5bf4f602df7453c68e9ba7504af0bd97e5ba34f0a1a5acc5f12aa3454d6de13fd1b60ead41c021597ebd98c1417059ac8235a2ac6336fcf7a8fd4b66d095d8f7.json"
20+
}
21+
]
22+
}

0 commit comments

Comments
 (0)