Closed Jovonni closed 1 month ago
Run using this image ghcr.io/agoric/agoric-sdk:a3p-use-upgrade-next-20240911203722-bc66a5
, with code hash 0b0999df67a96dd1048059a1806def6bd80195d2:
Test logs:
yarn lint
is passing again:
https://github.com/Agoric/dapp-orchestration-basics/actions/runs/10841759999/job/30086302600?pr=37
Fixing pipeline issue in test, not seeing this locally, digging:
configFile /home/runner/work/dapp-orchestration-basics/dapp-orchestration-basics/contract/config.yaml
Uncaught exception in test/orca-multichain.test.js
TypeError: Cannot assign to read only property 'message' of object 'FetchError'
TypeError: Cannot assign to read only property 'message' of object 'FetchError'
at new FetchError (/home/runner/work/dapp-orchestration-basics/dapp-orchestration-basics/node_modules/node-fetch/lib/index.js:146:16)
at ClientRequest.<anonymous> (/home/runner/work/dapp-orchestration-basics/dapp-orchestration-basics/node_modules/node-fetch/lib/index.js:1513:11)
at ClientRequest.emit (node:events:517:28)
at ClientRequest.emit (node:domain:489:12)
at Socket.socketErrorListener (node:_http_client:501:9)
at Socket.emit (node:events:517:28)
at Socket.emit (node:domain:489:12)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at processTicksAndRejections (node:internal/process/task_queues:82:21)
Uncaught exception in test/orca-multichain.test.js TypeError: Cannot assign to read only property 'message' of object 'FetchError'
Is the unit
job is picking up the starship-dependent test (test/orca-multichain.test.js
)? The fetch error looks like calls to useChain()
/ useRegistry()
were attempted without an exposed chain registry port
logs from e2e-tools fix @amessbee :
e2e-tools changes: https://github.com/Agoric/dapp-orchestration-basics/pull/37/commits/5712c46b5b828ac54743dcff827dfbe4e4755eaa
Makefile changes: https://github.com/Agoric/dapp-orchestration-basics/pull/37/commits/424fc9b4f48470c991947b067221737bf51ee8dc
agd-lib change: https://github.com/Agoric/dapp-orchestration-basics/pull/37/commits/cd008057e4b0ed8aa1c1643bd4bae954d17ea26d
client logs:
node logs:
This broke the way orca-multichain.test.js
runs
Fixed orca-multichain.test.js
run by not mixing up e2e tools the e2e script in contract/Makefile
runs, and the e2e tools orca-multichain.test.js
uses. Will revisit this, as both SHOULD be able to use the same e2e tools functions without much (or any) divergence in behavior...
Will revisit this, but this is for note taking, and ideation:
Here the difference between makeDeployBuilder functions (could paraneterize it with the path used in await tools.installBundles
):
export const makeDeployBuilder = (tools, readJSON, execa) =>
async function deployBuilder(builder) {
console.log(`building plan: ${builder}`);
// build the plan
const { stdout } = await execa`agoric run ${builder}`;
const match = stdout.match(/ (?<name>[-\w]+)-permit.json/);
if (!(match && match.groups)) {
throw new Error('no permit found');
}
const plan = await readJSON(`./${match.groups.name}-plan.json`);
console.log(plan);
console.log('copying files to container');
tools.copyFiles([
nodeRequire.resolve(`../${plan.script}`),
nodeRequire.resolve(`../${plan.permit}`),
...plan.bundles.map(b => b.fileName),
]);
console.log('installing bundles');
await tools.installBundles(
// plan.bundles.map(b => `/tmp/contracts/${b.bundleID}.json`),
plan.bundles.map(b => `/root/${b.bundleID}.json`), // <===== HERE
console.log,
);
console.log('executing proposal');
await tools.runCoreEval({
name: plan.name,
description: `${plan.name} proposal`,
});
};
export const makeDeployBuilderE2E = (tools, readJSON, execa) =>
async function deployBuilder(builder) {
console.log(`building plan: ${builder}`);
// build the plan
const { stdout } = await execa`agoric run ${builder}`;
const match = stdout.match(/ (?<name>[-\w]+)-permit.json/);
if (!(match && match.groups)) {
throw new Error('no permit found');
}
const plan = await readJSON(`./${match.groups.name}-plan.json`);
console.log(plan);
console.log('copying files to container');
tools.copyFiles([
nodeRequire.resolve(`../${plan.script}`),
nodeRequire.resolve(`../${plan.permit}`),
...plan.bundles.map(b => b.fileName),
]);
console.log('installing bundles');
await tools.installBundles(
plan.bundles.map(b => `/tmp/contracts/${b.bundleID}.json`),
// plan.bundles.map(b => `/root/${b.bundleID}.json`), // <===== HERE
console.log,
);
console.log('executing proposal');
await tools.runCoreEval({
name: plan.name,
description: `${plan.name} proposal`,
});
};
and here is the diffference between installBundles, and installBundlesE2E (could parameterize it to follow a different control flow based on if its for orca-multichain.test.js
, or the e2e
script to preserve DRY (if orca-multichain
, take simple path, else do more work etc) :
const installBundles = async (fullPaths, progress) => {
await null;
/** @type {Record<string, import('../test/boot-tools.js').CachedBundle>} */
const bundles = {};
// for (const [name, rootModPath] of Object.entries(bundleRoots)) {
console.log('fullPaths', fullPaths);
for (const fullPath of fullPaths) {
const { tx, confirm } = await installBundle(fullPath, {
id: fullPath,
agd,
follow: qt.query.follow,
progress,
delay,
// bundleId: getBundleId(bundle),
bundleId: undefined,
});
console.log('confirm', confirm);
progress({
// name,
id: fullPath,
installHeight: tx.height,
installed: confirm,
});
}
// eslint-disable-next-line no-undef
return harden(bundles);
};
const installBundlesE2E = async (fullPaths, progress) => {
await null;
/** @type {Record<string, import('../test/boot-tools.js').CachedBundle>} */
const bundles = {};
console.log('fullPaths', fullPaths);
console.log('getBundleId(bundle)');
for (const _fullPath of fullPaths) {
console.log('+fullPath');
console.log(_fullPath);
const pathSlices = _fullPath.split(',');
// if (pathSlices.length != 2) throw 'invalid path slices length';
const contractPath = pathSlices[0];
const proposalPath = pathSlices[1];
console.log('contractPath');
console.log(contractPath);
console.log('proposalPath');
console.log(proposalPath);
const fullPath = contractPath;
const containerPath = fullPath.includes('contract/src/')
? '/root/src/' + fullPath.split('contract/src/').pop()
: fullPath;
console.log('containerPath');
console.log(containerPath);
// load bundle
const bundle = await bundleCache.load(fullPath, 'orca');
const bundle_proposal = await bundleCache.load(proposalPath, 'orca');
console.log('bundle');
console.log(bundle);
console.log(bundle_proposal);
//copy to
const homeDir = os.homedir();
const bundleId = getBundleId(bundle);
const bundleFileName = path.join(
homeDir,
'.agoric/cache',
`${bundleId}.json`,
);
console.log('bundleFileName');
console.log(bundleFileName);
if (fs.existsSync(bundleFileName)) {
console.log(`copying ${bundleFileName} to container...`);
const copyCommand = `kubectl cp ${bundleFileName} agoriclocal-genesis-0:/root/bundles/${path.basename(bundleFileName)}`;
exec(copyCommand, (error, stdout, stderr) => {
if (error) {
console.error(`Error copying file: ${stderr}`);
return;
}
});
console.log(
`bundle copied to container at /root/${path.basename(bundleFileName)}`,
);
} else {
console.error(`bundle file ${bundleFileName} does not exist!`);
}
// generate plan, etc
const tools = await makeAgdTools(console.log, childProcess);
const contractBuilder = './test/builder/init-orca.js';
const { stdout } = await execa`agoric run ${contractBuilder}`;
const match = stdout.match(/ (?<name>[-\w]+)-permit.json/);
if (!(match && match.groups)) {
throw new Error('no permit found');
}
const plan = await fse.readJSON(`./${match.groups.name}-plan.json`);
console.log(plan);
console.log('copying files to containr');
// copy artifacts to container
tools.copyFiles([
nodeRequire.resolve(`../${plan.script}`),
nodeRequire.resolve(`../${plan.permit}`),
...plan.bundles.map(b => b.fileName),
]);
console.log(
'getBundleId(bundle)',
getBundleId(bundle),
plan.bundles[0].bundleID,
getBundleId(bundle) == plan.bundles[0].bundleID,
);
//install proposal
const proposalResult = await installBundle(
`/root/${plan.bundles[1].bundleID}.json`,
{
id: fullPath,
agd,
follow: qt.query.follow,
progress,
delay,
// bundleId: getBundleId(bundle),
bundleId: plan.bundles[1].bundleID,
// bundleId: undefined,
},
);
console.log('confirm_contract', proposalResult.confirm);
progress({
id: fullPath,
installHeight: proposalResult.tx.height,
installed: proposalResult.confirm,
});
//install contract
let { tx, confirm } = await installBundle(
`/root/${plan.bundles[0].bundleID}.json`,
{
id: fullPath,
agd,
follow: qt.query.follow,
progress,
delay,
// bundleId: getBundleId(bundle),
bundleId: plan.bundles[0].bundleID,
// bundleId: undefined,
},
);
console.log('confirm_contract', confirm);
progress({
// name,
id: fullPath,
installHeight: tx.height,
installed: confirm,
});
}
// eslint-disable-next-line no-undef
return harden(bundles);
};
Sanity check Testing for d3144de642a4b40cd046f3474d2a28ff484ddba6
:
yarn lint
[SUCCESS]
yarn test
[SUCCESS]
make e2e
[SUCCESS]
yarn ava ./test/orca-multichain.test.js
[FAIL PENDING] issue 'unknown value: [object Alleged: BLD brand#board0566]',
stack trace for unknown value
error:
✘ [fail]: Create and fund account on osmosis with denom: ubld Rejected promise returned by test
ℹ Provisioning Agoric smart wallet for agoric1sgh4a2uk4vawm6p8nz3y8andvpvax5v79n3dg4
ℹ osmosis makeCreateAndFund offer
ℹ Before doOffer
ℹ REJECTED from ava test.serial() "Create and fund account on osmosis with denom: ubld": (Error#1)
ℹ Error#1: unknown value: [object Alleged: BLD brand#board0566]
ℹ at noNewSlots (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/contract/tools/marshalTables.js:79:11)
at convertValToSlot (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/contract/tools/marshalTables.js:40:18)
at encodeSlotCommon (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:94:20)
at encodeSlotToSmallcaps (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:195:35)
at encodeRemotableToSmallcaps (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:205:9)
at encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:239:24)
at file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
at Array.map (<anonymous>)
at encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
at file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
at Array.map (<anonymous>)
at encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
at file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
at Array.map (<anonymous>)
at encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
at file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
at Array.map (<anonymous>)
at encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
at file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
at Array.map (<anonymous>)
at encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
at encodeToSmallcaps (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:290:19)
at Alleged: QueryTool.toCapData (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:222:23)
at sendAction (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/contract/tools/e2e-tools.js:213:23)
at Alleged: Offers.executeOffer (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/contract/tools/e2e-tools.js:225:26)
at executeOffer.next (<anonymous>)
at file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/contract/tools/e2e-tools.js:746:24
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Unhandled rejection in test/orca-multichain.test.js
Error: unknown value: [object Alleged: BLD brand#board0566]
› noNewSlots (file://tools/marshalTables.js:79:11)
› convertValToSlot (file://tools/marshalTables.js:40:18)
› encodeSlotCommon (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:94:20)
› encodeSlotToSmallcaps (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:195:35)
› encodeRemotableToSmallcaps (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:205:9)
› encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:239:24)
› file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
› Array.map (<anonymous>)
› encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
› file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
› Array.map (<anonymous>)
› encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
› file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
› Array.map (<anonymous>)
› encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
› file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
› Array.map (<anonymous>)
› encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
› file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:225:13
› Array.map (<anonymous>)
› encodeToSmallcapsRecur (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:223:17)
› encodeToSmallcaps (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/encodeToSmallcaps.js:290:19)
› Alleged: QueryTool.toCapData (file:///Users/jovonni/Documents/projects/devtes/tmp/dapp-orchestration-basics/node_modules/@endo/marshal/src/marshal.js:222:23)
› sendAction (file://tools/e2e-tools.js:213:23)
› Alleged: Offers.executeOffer (file://tools/e2e-tools.js:225:26)
› executeOffer.next (<anonymous>)
› file://tools/e2e-tools.js:746:24
Builds off of #32 work
This serves as a working rough draft of running dapp-orchestration-basics against
agoric-sdk:use-upgrade-next
image, see hereAddresses #12 for using ICQ successfully on a remote account, and maybe slightly progresses #33 as we can use this in the CI
End Result as expected
Both test orch accounts are funded as expected, and offer succeeds while invoking
getBalance
on remoteOrchestrationAccount without failing with error observed here:Successful remote account getBalance result from
makeCreateAndFund
:successful orca-multichain.test.js logs for
makeCreateAndFund
Multichain-testing image used
All other tests pass as well.
Small list of cleanup TODOs for monday: 1) revert any temporary testing setup (eg. Makefile with only running one tests, and uncomment other testing scenarios) 2) remove hardcoded test denom usage in offer handler, to use the offer arg param we pass in already 3) clean any debug code, run lint, and move this out of a draft PR 4) rebase with master for @turadg bundle shrinking work 5) autosquash fixup! commit here as well 6) get ci working again, this should be small, as I see something about a 7) investigate ci issue here, shouldn't be much as tests pass already