Skip to content

Commit

Permalink
Merge branch 'master' into JeancarloBarrios/adding-flake
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios authored Feb 15, 2025
2 parents c836435 + 8ef3fde commit 7a4c942
Show file tree
Hide file tree
Showing 296 changed files with 49,218 additions and 2,143 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '>=1.20'
go-version: '1.22'
cache: false
check-latest: true
# https://github.com/golangci/golangci-lint/issues/3862#issuecomment-1572973588
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
working-directory: ./agoric-sdk
- uses: ./agoric-sdk/.github/actions/restore-golang
with:
go-version: '1.20'
go-version: '1.22'
path: ./agoric-sdk
- uses: ./agoric-sdk/.github/actions/restore-node
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
submodules: 'true'
- uses: ./.github/actions/restore-golang
with:
go-version: '1.20'
go-version: '1.22'
- name: check protobuf definitions are up-to-date
run: |
cd packages/cosmic-proto
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-all-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ jobs:
# END-TEST-BOILERPLATE
- uses: ./.github/actions/restore-golang
with:
go-version: '1.20'
go-version: '1.22'
- name: yarn test (cosmic-swingset)
if: (success() || failure())
run: cd packages/cosmic-swingset && yarn ${{ steps.vars.outputs.test }} | $TEST_COLLECT
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- uses: ./.github/actions/restore-golang
with:
go-version: '1.20'
go-version: '1.22'
- name: go test
run: cd golang/cosmos && go test -coverprofile=coverage.txt -covermode=atomic ./...
- uses: ./.github/actions/post-test
Expand Down
12 changes: 8 additions & 4 deletions a3p-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@
"build:submissions": "scripts/build-all-submissions.sh",
"build:synthetic-chain": "yarn synthetic-chain build",
"lint-fix": "yarn lint:eslint --fix",
"lint": "../node_modules/.bin/run-s --continue-on-error 'lint:*'",
"lint": "run-s --continue-on-error 'lint:*'",
"lint:types": "find proposals -maxdepth 2 -name package.json -type f -exec ../node_modules/.bin/tsc -p '{}'/.. ';'",
"lint:eslint": "../node_modules/.bin/eslint .",
"lint:eslint": "eslint .",
"test": "yarn synthetic-chain test",
"doctor": "yarn synthetic-chain doctor"
},
"dependencies": {
"@agoric/synthetic-chain": "^0.5.1",
"@agoric/synthetic-chain": "^0.5.2",
"@types/better-sqlite3": "^7.6.11"
},
"packageManager": "[email protected]",
"devDependencies": {
"eslint": "^8.57.1",
"npm-run-all": "^4.1.5"
},
"packageManager": "[email protected]",
"license": "Apache-2.0"
}
4 changes: 2 additions & 2 deletions a3p-integration/proposals/b:beta-fast-usdc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"@agoric/client-utils": "dev",
"@agoric/fast-usdc": "dev",
"@agoric/synthetic-chain": "^0.5.1",
"@agoric/synthetic-chain": "^0.5.2",
"@endo/init": "^1.1.8",
"agoric": "dev",
"ava": "^5.3.1"
Expand All @@ -28,5 +28,5 @@
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
},
"packageManager": "yarn@4.5.3"
"packageManager": "yarn@4.6.0"
}
7 changes: 4 additions & 3 deletions a3p-integration/proposals/b:beta-fast-usdc/test/test-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ yarn agoric wallet send --offer accept.json --from agoric1ee9hr0jyrxhy999y755mp8
# UNTIL https://github.com/Agoric/agoric-sdk/issues/10891
# ACCEPT_OFFER_ID=$(agoric wallet extract-id --offer accept.json)

yarn fast-usdc operator attest --previousOfferId="$ACCEPT_OFFER_ID" --forwardingChannel=foo --recipientAddress=agoric1foo --blockHash=0xfoo --blockNumber=1 --chainId=3 --amount=123 --forwardingAddress=noble1foo --sender 0xfoo --txHash=0xtx >| attest.json
cat attest.json
yarn agoric wallet send --offer attest.json --from agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q --keyring-backend test
# FIXME restore this test once the latest fast-usdc package is in NPM
# yarn fast-usdc operator attest --previousOfferId="$ACCEPT_OFFER_ID" --forwardingChannel=foo --recipientAddress=agoric1foo --blockHash=0xfoo --blockNumber=1 --blockTimestamp=1632340000 --chainId=3 --amount=123 --forwardingAddress=noble1foo --sender 0xfoo --txHash=0xtx >| attest.json
# cat attest.json
# yarn agoric wallet send --offer attest.json --from agoric1ee9hr0jyrxhy999y755mp862ljgycmwyp4pl7q --keyring-backend test

# The data above are bogus and result in errors in the logs:
# SwingSet: vat: v72: ----- TxFeed.11 8 publishing evidence { aux: { forwardingChannel: 'foo', recipientAddress: 'agoric1foo' }, blockHash: '0xfoo', blockNumber: 1n, chainId: 3, tx: { amount: 123n, forwardingAddress: 'noble1foo', sender: '0xfoo' }, txHash: '0xtx' } []
Expand Down
22 changes: 11 additions & 11 deletions a3p-integration/proposals/b:beta-fast-usdc/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,19 @@ __metadata:
languageName: node
linkType: hard

"@agoric/synthetic-chain@npm:^0.5.1":
version: 0.5.1
resolution: "@agoric/synthetic-chain@npm:0.5.1"
"@agoric/synthetic-chain@npm:^0.5.2":
version: 0.5.2
resolution: "@agoric/synthetic-chain@npm:0.5.2"
dependencies:
"@endo/zip": "npm:^1.0.7"
better-sqlite3: "npm:^11.8.0"
"@endo/zip": "npm:^1.0.9"
better-sqlite3: "npm:^11.8.1"
chalk: "npm:^5.4.1"
cosmjs-types: "npm:^0.9.0"
execa: "npm:^9.5.2"
glob: "npm:^11.0.0"
glob: "npm:^11.0.1"
bin:
synthetic-chain: dist/cli/cli.js
checksum: 10c0/38d796556a0940d124b750bcf82cbbbd9caee64031feeca4086350c4d05d68256e5b188d418354b511eeb1da0f95160205cc2701ae397bd86c304fc29850bc85
checksum: 10c0/190939c33f47a1d71558356f42d4b4b10a4caf3176d31281a250877f97d25d5df5b5d261fd507489fd481e24e6ba5ec12e8dc267a0461b67e9f02a8f8769700c
languageName: node
linkType: hard

Expand Down Expand Up @@ -1260,7 +1260,7 @@ __metadata:
languageName: node
linkType: hard

"@endo/zip@npm:^1.0.7, @endo/zip@npm:^1.0.9":
"@endo/zip@npm:^1.0.9":
version: 1.0.9
resolution: "@endo/zip@npm:1.0.9"
checksum: 10c0/3fccea31bd5dad938a3b5f531454d3c49513892d6d5aba1f0af1034ff0ae54c3e28a346a9df08bd9e5201354acccd631e45c9c0e68fa2848a876a3919f3830dc
Expand Down Expand Up @@ -2003,7 +2003,7 @@ __metadata:
languageName: node
linkType: hard

"better-sqlite3@npm:^11.8.0":
"better-sqlite3@npm:^11.8.1":
version: 11.8.1
resolution: "better-sqlite3@npm:11.8.1"
dependencies:
Expand Down Expand Up @@ -3173,7 +3173,7 @@ __metadata:
languageName: node
linkType: hard

"glob@npm:^11.0.0":
"glob@npm:^11.0.1":
version: 11.0.1
resolution: "glob@npm:11.0.1"
dependencies:
Expand Down Expand Up @@ -4829,7 +4829,7 @@ __metadata:
dependencies:
"@agoric/client-utils": "npm:dev"
"@agoric/fast-usdc": "npm:dev"
"@agoric/synthetic-chain": "npm:^0.5.1"
"@agoric/synthetic-chain": "npm:^0.5.2"
"@endo/init": "npm:^1.1.8"
agoric: "npm:dev"
ava: "npm:^5.3.1"
Expand Down
10 changes: 1 addition & 9 deletions a3p-integration/proposals/n:upgrade-next/.gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
replaceFeeDistributor/
addUsdLemons/
addUsdOlives/
upgradeProvisionPool/
upgradeAgoricNames/
publishTestInfo/
upgrade-mintHolder/
upgradeAssetReserve/
upgradePSM/
test/generated/
2 changes: 2 additions & 0 deletions a3p-integration/proposals/n:upgrade-next/eval.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -euo pipefail

# evaluate the proposals in the /submission/ directory

echo "UPGRADE-19 Running proposal declared in package.json"
Expand Down
17 changes: 5 additions & 12 deletions a3p-integration/proposals/n:upgrade-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@
},
"type": "Software Upgrade Proposal",
"sdk-generate": [
"testing/replace-feeDistributor-short.js replaceFeeDistributor",
"testing/add-USD-LEMONS.js addUsdLemons",
"vats/upgrade-provisionPool.js upgradeProvisionPool",
"vats/upgrade-asset-reserve.js upgradeAssetReserve",
"vats/upgrade-psm.js upgradePSM",
"vats/upgrade-paRegistry.js",
"vats/upgrade-agoricNames.js agoricNamesCoreEvals/upgradeAgoricNames",
"testing/add-USD-OLIVES.js agoricNamesCoreEvals/addUsdOlives",
"testing/publish-test-info.js agoricNamesCoreEvals/publishTestInfo",
"vats/upgrade-mintHolder.js upgrade-mintHolder A3P_INTEGRATION"
"testing/add-USD-LEMONS.js test/generated/addUsdLemons",
"testing/add-USD-OLIVES.js test/generated/agoricNamesCoreEvals/addUsdOlives",
"testing/publish-test-info.js test/generated/agoricNamesCoreEvals/publishTestInfo"
]
},
"type": "module",
Expand All @@ -26,7 +19,7 @@
"@agoric/client-utils": "dev",
"@agoric/ertp": "dev",
"@agoric/internal": "dev",
"@agoric/synthetic-chain": "^0.5.1",
"@agoric/synthetic-chain": "^0.5.2",
"@agoric/zoe": "dev",
"@endo/errors": "^1.2.9",
"@endo/init": "^1.1.8",
Expand All @@ -46,7 +39,7 @@
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
},
"packageManager": "yarn@4.5.3",
"packageManager": "yarn@4.6.0",
"devDependencies": {
"eslint": "^8.57.0",
"npm-run-all": "^4.1.5",
Expand Down
81 changes: 0 additions & 81 deletions a3p-integration/proposals/n:upgrade-next/psm.test.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
/* eslint-env node */

import {
agoric,
evalBundles,
getDetailsMatchingVats,
getISTBalance,
} from '@agoric/synthetic-chain';
import { makeVstorageKit, retryUntilCondition } from '@agoric/client-utils';
import { agoric, evalBundles, getISTBalance } from '@agoric/synthetic-chain';
import { makeVstorageKit } from '@agoric/client-utils';
import { readFile, writeFile } from 'node:fs/promises';
import { psmSwap, snapshotAgoricNames, tryISTBalances } from './psm-lib.js';

Expand Down Expand Up @@ -41,7 +36,10 @@ export const getAssetList = async labelList => {

// Determine the assets to consider based on labelList
const assetsToConsider =
labelList || Object.values(vbankAssets).map(asset => asset.issuerName);
labelList ||
Object.values(vbankAssets)
.map(asset => asset.issuerName)
.filter(Boolean); // testvbankAsset can be malformed.

for (const label of assetsToConsider) {
if (label === 'IST') {
Expand All @@ -67,6 +65,7 @@ export const mintPayment = async (t, address, assetList, value) => {

for (const asset of assetList) {
const { label, denom } = asset;

const scaled = BigInt(parseInt(value, 10) * 1_000_000).toString();

await replaceTemplateValuesInFile(`${SUBMISSION_DIR}/send-script`, {
Expand Down Expand Up @@ -137,40 +136,3 @@ export const swap = async (t, address, assetList, want) => {
t.is(anchorBalanceAfter, anchorBalanceBefore - want);
}
};

const getIncarnationForAllVats = async assetList => {
const vatsIncarnation = {};

for (const asset of assetList) {
const { label, mintHolderVat } = asset;
const matchingVats = await getDetailsMatchingVats(label);
const expectedVat = matchingVats.find(vat => vat.vatName === mintHolderVat);
vatsIncarnation[label] = expectedVat.incarnation;
}
assert(Object.keys(vatsIncarnation).length === assetList.length);

return vatsIncarnation;
};

const checkVatsUpgraded = (before, current) => {
for (const vatLabel in before) {
if (current[vatLabel] !== before[vatLabel] + 1) {
console.log(`${vatLabel} upgrade failed. `);
return false;
}
}
return true;
};

export const upgradeMintHolder = async (submissionPath, assetList) => {
const before = await getIncarnationForAllVats(assetList);

await evalBundles(submissionPath);

return retryUntilCondition(
async () => getIncarnationForAllVats(assetList),
current => checkVatsUpgraded(before, current),
`mintHolder upgrade not processed yet`,
{ setTimeout, retryIntervalMs: 5000, maxRetries: 15 },
);
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env node */
// from z:acceptance/test-lib/psm-lib.js
// from z:acceptance/lib/psm-lib.js

import { execa } from 'execa';
import { getNetworkConfig } from 'agoric/src/helpers.js';
Expand Down
Loading

0 comments on commit 7a4c942

Please sign in to comment.