Skip to content

Commit

Permalink
perf measurement for Fast USDC in multichain-testing (#10857)
Browse files Browse the repository at this point in the history
closes: #10595

## Description

  - within `advanceAndSettleScenario`, measure from start of OCW submission to receipt of advanced funds
    - multichain-testing env using `console.timeLog()` 
    - mainnet estimate using blocks elapsed * 7 sec
  - refine oracle submission to return without waiting for payouts

### Security / Scaling / Documentation / Upgrade Considerations

n/a - test code only

### Testing Considerations

Perf measurement does *not* include time between when the user says "go" and when the OCWs notice the transaction in a block and start to submit. Presumably this is around 5sec - 10 sec; the test pads timing to accommodate for such things (`MARGIN_OF_ERROR = 0.2`).
  • Loading branch information
mergify[bot] authored Jan 22, 2025
2 parents 8fb6eaf + 2c79e74 commit cb12196
Show file tree
Hide file tree
Showing 8 changed files with 447 additions and 172 deletions.
23 changes: 1 addition & 22 deletions multichain-testing/scripts/fast-usdc-tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { ExecutionContext } from 'ava';
import { encodeAddressHook } from '@agoric/cosmic-proto/address-hooks.js';
import { AmountMath, type Brand } from '@agoric/ertp';
import type { USDCProposalShapes } from '@agoric/fast-usdc/src/pool-share-math.js';
import type { PoolMetrics } from '@agoric/fast-usdc/src/types.js';
import { divideBy } from '@agoric/zoe/src/contractSupport/ratio.js';
import { makeDenomTools } from '../tools/asset-info.js';
import { makeDoOffer } from '../tools/e2e-tools.js';
Expand All @@ -17,6 +16,7 @@ import {
makeFeedPolicyPartial,
oracleMnemonics,
} from '../test/fast-usdc/config.js';
import { agoricNamesQ, fastLPQ } from '../test/fast-usdc/fu-actors.js';

const USAGE = `
Usage:
Expand Down Expand Up @@ -55,27 +55,6 @@ const runT = {
},
} as ExecutionContext;

// from ../test/fast-usdc/fast-usdc.test.ts
type VStorageClient = Awaited<ReturnType<typeof commonSetup>>['vstorageClient'];
const agoricNamesQ = (vsc: VStorageClient) =>
harden({
brands: <K extends AssetKind>(_assetKind: K) =>
vsc
.queryData('published.agoricNames.brand')
.then(pairs => Object.fromEntries(pairs) as Record<string, Brand<K>>),
});

const fastLPQ = (vsc: VStorageClient) =>
harden({
metrics: () =>
vsc.queryData(`published.fastUsdc.poolMetrics`) as Promise<PoolMetrics>,
info: () =>
vsc.queryData(`published.${contractName}`) as Promise<{
poolAccount: string;
settlementAccount: string;
}>,
});

const parseCommandLine = () => {
const { values, positionals } = parseArgs({
options: {
Expand Down
Loading

0 comments on commit cb12196

Please sign in to comment.