Skip to content
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

SPIKE: prototype participants in Fast USDC sequence diagram #10254

Closed
wants to merge 48 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
dd751ff
docs: missing typeof
dckc Oct 19, 2024
ef9f55e
chore: let makeRunUtils caller provide run policy
dckc Oct 28, 2024
d699361
refactor: factor out computronCounter
dckc Oct 28, 2024
8d2793b
test(boot): thread computron counter thru test context
dckc Oct 29, 2024
f715b73
test: demo SWINGSET_WORKER_TYPE, computron count
dckc Oct 29, 2024
f3883e4
test: bootstrap test for trivial quickSend contract
dckc Sep 19, 2024
1620ffc
chore(quickSend): skip bootstrap test (WIP)
dckc Oct 10, 2024
368cbeb
test: reify participants from Fast USDC sequence diagram
dckc Oct 10, 2024
c7a8b96
refactor: move contract logic to .contract.js file
dckc Oct 10, 2024
eb59f53
test: refine quickSend prototype
dckc Oct 11, 2024
0131fea
test: accept watcher invitation bootstrap test (WIP)
dckc Oct 14, 2024
1657d20
test(quickSend): accept watcher invitation (done)
dckc Oct 14, 2024
223b58a
test(quickSend): restore ava test
dckc Oct 14, 2024
31b95d5
feat(quickSend): thread watcherAddress config out to builder CLI
dckc Oct 17, 2024
342313d
chore: quick-n-dirty vstorage client w/explicit io
dckc Oct 17, 2024
473f147
test(quickSend): a3p deployment to agoricNames.instance
dckc Oct 17, 2024
02ad1bd
chore: extract computron-counter for boot testing
dckc Oct 21, 2024
1c07c4b
test(quickSend): initial computron performance measurement
dckc Oct 19, 2024
e91261a
fix(quickSend): contract requires USDC brand
dckc Oct 20, 2024
41ded8c
chore(quickSend): register USDC asset for transfer
dckc Oct 20, 2024
8094739
test(quickSend): measure advance computrons
dckc Oct 20, 2024
c55f27d
test: fix computron handling; report Mc
dckc Oct 22, 2024
60832db
chore: support $SLOGFILE in quickSend perf test
dckc Oct 22, 2024
23b2c41
chore: mock registerAsset in quickSend-tx.test
dckc Oct 22, 2024
da6949b
refactor: fast-usdc files to own package
turadg Oct 21, 2024
38ac63f
test(fast-usdc): tx lifecycle no longer failing
dckc Oct 23, 2024
1375ac1
test(fast-usdc): restore quickSend boot test
dckc Oct 23, 2024
85bae1d
chore(deps): avoid cycle by pruning agoric
dckc Oct 24, 2024
652c459
chore(fast-usdc): turn off compilerOptions.strict
dckc Oct 24, 2024
bfe06a0
chore(deps): fast-usdc devDependencies
dckc Oct 24, 2024
7c7d238
chore(deps): fast-usdc contract dependencies
dckc Oct 24, 2024
f10b43b
docs(fast-usdc): WIP: initAccounts @ts-expect-error
dckc Oct 24, 2024
f8aebcf
docs(fast-usdc): types for .flows
dckc Oct 24, 2024
eedcfdf
test(fast-usdc): types for agoric-mock
dckc Oct 24, 2024
8beb9db
refactor: simplify io in quick-load.test
dckc Oct 24, 2024
9326496
v0.0.0
dckc Oct 25, 2024
f000b5b
chore(fast-usdc): use CCTPTxEvidence in flows
dckc Oct 25, 2024
1e15177
test(fast-usdc): update mocks to use CCTPTxEvidence in logs
dckc Oct 25, 2024
cc8d0a0
docs: refine type of NobleCalc.fwdAddressFor
dckc Oct 29, 2024
5787716
test: re-integrate computron counter
dckc Oct 29, 2024
e5352f1
test: update bootstrap test for CCTPTxEvidence
dckc Oct 29, 2024
1fbd6f8
chore(fast-usdc): move IST/USDC kludge from core-eval to test
dckc Oct 29, 2024
631684a
chore(fast-usdc): fee account pre-exists contract
dckc Oct 29, 2024
0e9f794
chore(fast-usdc): docker-compose file for ad-hoc deployment testing
dckc Nov 4, 2024
bedff43
chore: copy deploy-cli and deps from dapp-orch
dckc Nov 4, 2024
66e17e6
chore: port deploy-cli for ad-hoc deployment
dckc Nov 4, 2024
d736cb0
feat: support scriptArgs in deploy-cli
dckc Nov 4, 2024
74d293b
KLUDGE: USDC_axl
dckc Nov 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions a3p-integration/proposals/d:quick-send/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
27 changes: 27 additions & 0 deletions a3p-integration/proposals/d:quick-send/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"agoricProposal": {
"source": "subdir",
"sdk-generate": [
"vats/init-orchestration.js",
"fast-usdc/init-quickSend.js"
],
"type": "/agoric.swingset.CoreEvalProposal"
},
"type": "module",
"license": "Apache-2.0",
"dependencies": {
"@agoric/synthetic-chain": "^0.3.0",
"ava": "^5.3.1"
},
"ava": {
"concurrency": 1,
"timeout": "2m",
"files": [
"!submission"
]
},
"scripts": {
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops"
},
"packageManager": "[email protected]"
}
20 changes: 20 additions & 0 deletions a3p-integration/proposals/d:quick-send/quick-load.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// @ts-check
/* global globalThis */
import test from 'ava';
import { extractStreamCellValue } from '@agoric/synthetic-chain';
import { localAPI, makeLCD } from './test-lib/cosmos-api.js';
import { makeVStorage } from './test-lib/vstorage-client.js';

const io = { api: makeLCD(localAPI, { fetch: globalThis.fetch }) };

test('quickSend is in agoricNames.instance', async t => {
const vs = makeVStorage(io.api);
const data = await vs.readStorage('published.agoricNames.instance');
const value = extractStreamCellValue(data);
assert.typeof(value, 'string');
const capData = JSON.parse(value);
const encoding = JSON.parse(capData?.body.replace(/^#/, ''));
const byName = Object.fromEntries(encoding);
t.log('agoricNames.instance keys', Object.keys(byName));
t.truthy(byName.quickSend);
});
42 changes: 42 additions & 0 deletions a3p-integration/proposals/d:quick-send/test-lib/cosmos-api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// @ts-check
const { freeze } = Object;

/**
* @see {@link https://docs.cosmos.network/v0.46/core/grpc_rest.html#rest-server}
*/
export const defaultAPIPort = 1317;
export const localAPI = `http://localhost:${defaultAPIPort}`;

/**
* @param {string} apiURL
* @param {object} io
* @param {typeof fetch} io.fetch
*/
export const makeLCD = (apiURL, { fetch }) => {
if (typeof apiURL !== 'string') throw TypeError(typeof apiURL);

/**
* @param {string} href
* @param {object} [options]
* @param {Record<string, string>} [options.headers]
*/
const getJSON = async (href, options = {}) => {
const opts = {
keepalive: true,
headers: {
'Content-Type': 'application/json',
...options.headers,
},
};
const url = `${apiURL}${href}`;
const r = await fetch(url, opts);
if (!r.ok) throw Error(r.statusText);
return r.json();
};

return freeze({
getJSON,
latestBlock: () => getJSON(`/cosmos/base/tendermint/v1beta1/blocks/latest`),
});
};
/** @typedef {ReturnType<makeLCD>} LCD */
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// @ts-check

/**
* @param {import("./cosmos-api").LCD} lcd
*/
export const makeVStorage = lcd => {
const getJSON = (href, options) => lcd.getJSON(href, options);

// height=0 is the same as omitting height and implies the highest block
const href = (path = 'published', { kind = 'data' } = {}) =>
`/agoric/vstorage/${kind}/${path}`;
const headers = height =>
height ? { 'x-cosmos-block-height': `${height}` } : undefined;

const readStorage = (
path = 'published',
{ kind = 'data', height = 0 } = {},
) =>
getJSON(href(path, { kind }), { headers: headers(height) }).catch(err => {
throw Error(
`cannot read ${kind} of ${path}: ${err.message} ${err?.cause.message}`,
);
});
const readCell = (path, opts) =>
readStorage(path, opts)
.then(data => data.value)
.then(s => (s === '' ? {} : JSON.parse(s)));

return {
lcd,
readStorage,
readCell,
};
};
2 changes: 2 additions & 0 deletions a3p-integration/proposals/d:quick-send/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
yarn ava
Loading