Skip to content

Commit c101e37

Browse files
authored
retry install-bundle in multichain test (#11155)
closes: #9934 ## Description The **Fund Provision Pool** job is stable now, so the next one is flaking, **Override Chain Registry**. ``` ----- Depl.5 5 installing bundles ----- Agd.3 2 $ agd tx swingset install-bundle @/tmp/contracts/b1-1fc262aefef4f13a10b2b116e07e4c8539619479f01fe6bd03fae243d2765c88b86054f15331c6d3c94c424d65a9fb0a3e8684d20ee4d31c6c9b705d6053e3c8.json --keyring-backend test --chain-id agoriclocal --from agoric1hm54wrxsv8e3pnw6lxj5lssfpexn48xtj6fhxw --broadcast-mode block --gas auto --gas-adjustment 1.4 --yes --output json deploy failed, trying again (Error#1) Error#1: Command failed: kubectl exec -i agoriclocal-genesis-0 -c validator --tty=false -- agd tx swingset install-bundle @/tmp/contracts/b1-1fc262aefef4f13a10b2b116e07e4c8539619479f01fe6bd03fae243d2765c88b86054f15331c6d3c94c[42](https://github.com/Agoric/agoric-sdk/actions/runs/13998860883/job/39200487363#step:12:43)4d65a9fb0a3e8684d20ee4d31c6c9b705d6053e3c8.json --keyring-backend test --chain-id agoriclocal --from agoric1hm54wrxsv8e3pnw6lxj5lssfpexn48xtj6fhxw --broadcast-mode block --gas auto --gas-adjustment 1.4 --yes --output json Error: rpc error: code = Unknown desc = rpc error: code = Unknown desc = account sequence mismatch, expected 24, got 23: incorrect account sequence [agoric-labs/[email protected]/x/auth/ante/sigverify.go:269] With gas wanted: '18446744073709551615' and gas used: '1840763' : unknown request ``` It had a retry but wasn't waiting a block. This makes it wait a block. ### Security Considerations It uses a global `fetch`. This is running in a Node env and just test code so I think it's warranted. ### Scaling Considerations none ### Documentation Considerations none ### Testing Considerations If it passes, land it and hope it fixes the flake. ### Upgrade Considerations n/a
2 parents 0ea3ad5 + 3768168 commit c101e37

File tree

2 files changed

+28
-30
lines changed

2 files changed

+28
-30
lines changed

multichain-testing/scripts/fund-provision-pool.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,10 @@ async function fundProvisionPool(args: {
3737
console.log(`Funding provision pool at ${address} with ${amount}...`);
3838

3939
// TODO: `@agoric/client-utils` should publish `waitForBlock`
40-
const { waitForBlock } = (() => {
41-
const delay = (ms: number): Promise<void> =>
42-
new Promise(resolve => setTimeout(resolve, ms));
43-
const explainDelay = (ms, info) => {
44-
if (typeof info === 'object' && Object.keys(info).length > 0) {
45-
console.log('delay', { ...info, delay: ms / 1000 }, '...');
46-
}
47-
return delay(ms);
48-
};
49-
const rpc = makeHttpClient(rpcUrl, fetch);
50-
return makeBlockTool({
51-
rpc,
52-
delay: explainDelay,
53-
});
54-
})();
40+
const { waitForBlock } = makeBlockTool({
41+
rpc: makeHttpClient(rpcUrl, fetch),
42+
delay: ms => new Promise(resolve => setTimeout(resolve, ms)),
43+
});
5544

5645
try {
5746
await waitForBlock(1);

multichain-testing/tools/e2e-tools.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ import { makeTracer } from '@agoric/internal';
2222

2323
const trace = makeTracer('E2ET');
2424

25-
// The default of 6 retries was failing.
26-
// XXX also tried 15, 30. There's probably something deeper to fix.
27-
const SMART_WALLET_PROVISION_RETRIES = 100;
2825
const PROVISIONING_POOL_ADDR = 'agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346';
2926

3027
const BLD = '000000ubld';
3128

29+
const rpcUrl = 'http://localhost:26657';
30+
3231
export const txAbbr = tx => {
3332
const { txhash, code, height, gas_used } = tx;
3433

@@ -106,20 +105,34 @@ export const makeBlockTool = ({ rpc, delay }) => {
106105
* @param {string} [opts.bundleId]
107106
*/
108107
const installBundle = async (fullPath, opts) => {
109-
const { id, agd, progress = console.log } = opts;
108+
const { id, agd, delay, progress = console.log } = opts;
110109
const { chainId = 'agoriclocal', installer = 'faucet' } = opts;
111-
const from = await agd.lookup(installer);
110+
const from = agd.lookup(installer);
112111
// const explainDelay = (ms, info) => {
113112
// progress('follow', { ...info, delay: ms / 1000 }, '...');
114113
// return delay(ms);
115114
// };
116115
// const updates = follow('bundles', { delay: explainDelay });
117116
// await updates.next();
118-
const tx = await agd.tx(['swingset', 'install-bundle', `@${fullPath}`], {
119-
from,
120-
chainId,
121-
yes: true,
122-
});
117+
const installBundle = () =>
118+
agd.tx(['swingset', 'install-bundle', `@${fullPath}`], {
119+
from,
120+
chainId,
121+
yes: true,
122+
});
123+
let tx;
124+
try {
125+
tx = await installBundle();
126+
} catch (err) {
127+
console.warn('WARN: retrying failed install-bundle', err);
128+
// TODO make available from client-utils
129+
const { waitForBlock } = makeBlockTool({
130+
rpc: makeHttpClient(rpcUrl, global.fetch),
131+
delay,
132+
});
133+
await waitForBlock(1);
134+
tx = await installBundle();
135+
}
123136
assert(tx);
124137

125138
progress({ id, installTx: tx.txhash, height: tx.height });
@@ -131,7 +144,7 @@ const installBundle = async (fullPath, opts) => {
131144
// assert.equal(`b1-${confirm.endoZipBase64Sha512}`, opts.bundleId);
132145
// }
133146
// TODO: return block height at which confirm went into vstorage
134-
return { tx, confirm: true };
147+
return { tx, confirm: { installed: true } };
135148
};
136149

137150
/**
@@ -241,9 +254,6 @@ const provisionSmartWalletAndMakeDriver = async (
241254
() => q.queryData(`published.wallet.${address}.current`),
242255
result => !!result,
243256
`wallet in vstorage ${address}`,
244-
{
245-
maxRetries: SMART_WALLET_PROVISION_RETRIES,
246-
},
247257
);
248258
progress({
249259
provisioned: address,
@@ -549,7 +559,6 @@ export const makeE2ETools = async (
549559
// name,
550560
id: fullPath,
551561
installHeight: tx.height,
552-
// @ts-expect-error confirm is a boolean?
553562
installed: confirm.installed,
554563
});
555564
}

0 commit comments

Comments
 (0)