-
Notifications
You must be signed in to change notification settings - Fork 212
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
test: fast-usdc contract flow #10572
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
currently (e049c85) passing tests:
|
e4052ae
to
e049c85
Compare
@0xpatrickdev , @turadg , based on today's discussion of scope, I think this is ready for review. |
Why is this inter protocol test failing???
strangely, it reproduces locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Only have one comment that really needs addressing.
I am not the craziest about the single shared test context and test.serials. It makes it so that we can't do yarn test ... -m 'STORY01:*'
to debug or work on an individual test. Speaking offline it seemed more cost effective to structure this way, so I won't block on this.
*/ | ||
onRejected(_result, _ctx) { | ||
onRejected(reason, ctx) { | ||
trace('transfer rejected!', reason, ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this have a
@@ -98,7 +98,7 @@ export const connectionKey = (chainId1, chainId2) => { | |||
*/ | |||
const reverseConnInfo = connInfo => { | |||
const { transferChannel } = connInfo; | |||
return { | |||
return harden({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hit this as well: 33f26e9
|
||
console.log('chainHub: registering assets', Object.keys(assetInfo || {})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice additions
const assetInfo = harden( | ||
Object.fromEntries([ | ||
assetOn('uusdc', 'noble'), | ||
[uusdcOnAgoric, agUSDCDetail], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assetOn
is nifty. Why not also use it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was used to define these 2.
uusdOnAgoric is exported for use elsewhere.
@@ -264,13 +275,13 @@ export const prepareSettler = ( | |||
* @param {SettlerTransferCtx} ctx | |||
* | |||
* @typedef {{ | |||
* txHash: EvmHash; | |||
* txHash: EvmHash | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When can this be undefined
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only in the case that we're not handling correctly (#10577). I might as well fix it now.
}); | ||
|
||
test.todo( | ||
'PERF: Target: settlement completes in a few minutes (after USDC is minted)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will be the right place for this, since much of the latency is dependent on blocks and bridges, so maybe we should omit this todo. Would we do this in multichain-testing
? a testnet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will be the right place for this,
I agree, but this is where I was taking notes on product requirements. I'll take this one out, but note that there are also TODOs here that should be satisfied by exo tests. When the TODOs get done, we can prune these notes.
since much of the latency is dependent on blocks and bridges, so maybe we should omit this todo. Would we do this in multichain-testing? a testnet?
We have plans for bootstrap tests to measure computrons as well as multichain-testing and testnets.
// TODO/WIP: cust.racer3.checkSent(t, since(bridgePos), 'forward - LP depleted'); | ||
await transmitTransferAck(); | ||
// Nothing we can check here, unless we want to inspect calls to `trace`. | ||
// `test/exos/advancer.test.ts` covers calls to `log: LogFn` with mocks. | ||
// This is still helpful to call, so we can observe "Advance transfer | ||
// fulfilled" in the test output. | ||
await transmitTransferAck(); | ||
await transmitTransferAck(); | ||
await Promise.all([mint(sent1), mint(sent2), mint(sent3)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is cool, but I'm struggling to understand how we plan to check the results of the Promise.all. I don't think we'll have any bridge messages that indicate insufficient funds (advancer's log
would know though.) Will we wait for txs to be posted to vstorage?
Regardless, consider specifying in the TODO/WIP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as I was working on this test, I realized that our mock bridge stuff only works one tx at a time. I'm not inclined to go on at any length about what's TODO/WIP here just now.
const bridgeTraffic = since(bridgePos); | ||
await mint(sent); | ||
custEmpty.checkSent(t, bridgeTraffic, 'forward'); | ||
t.log('No advancement, just settlement'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a TODO somewhere here to ensure Observed
and/or Forwarded
statuses are recorded in vstorage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M2
|
||
// advancedEarly stuff | ||
test.todo( | ||
'C12 - Contract MUST only pay back the Pool only if they started the advance before USDC is minted', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is advance early, but also could be the same scenario about. We could inspect the outgoing LCA bridge messages to confirm they sent the requested amount and not the net of fees amount
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could inspect the outgoing LCA bridge messages to confirm they sent the requested amount and not the net of fees amount
checkSent
with 'forward'
does check that.
But we didn't test the advancedEarly
case, i.e. the case where the mint comes in between ADVANCING and ADVANCED.
|
||
test.todo('C18 - forward - MUST log and alert these incidents'); | ||
|
||
test.serial.failing( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this failing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I say, might as well fix it now.
non-hardened objects can't go in stores such as `connectionInfos`.
- realistic USDC denom in test supports
10 tests passed 1 known failure 2 tests skipped 7 tests todo Done in 3.43s. - [skip] LP borrow - TODO: move to exo test - [skip] LP repay - TODO: move to exo test - [todo] PERF: Target: settlement completes in a few minutes (after USDC is minted) - [todo] C21 - Contract MUST log / timestamp each step in the transaction flow - [todo] document metrics storage schema - [todo] get metrics from vstorage - [todo] C12 - Contract MUST only pay back the Pool only if they started the advance before USDC is minted - [todo] C18 - forward - MUST log and alert these incidents - [todo] fee levels MUST be visible to external parties - i.e., written to public storage - known failure: unknown transaction settler should Leave funds in SettlementAccount. - use oracle, customer in advance happy path - factor out makeOracleOperator - registerAsset() from the test jig doesn't work: brands in the contract are in a different "address space" - use realistic USDC denom - shared context for contract tests - customer sends before LPs deposit - racer tests - flatten makeLP - don't mix with pourPayment - derive publicFacet etc. from instance as client would - skip LP test that used test-only methods - prune outdated Oracle rights test
ee85747
to
2f4bafe
Compare
17b6d85
to
dcc6feb
Compare
refs: #10388
closes: #10577
doesn't close until
Description / Testing Considerations
postponed:
some
test.todo()
s are out of scope of contract flow tests. Some are more feasible as exo tests:an some are after M1:
Security / Scaling / Upgrade Considerations
n/a
Documentation Considerations
Internal design docs are assumed background knowledge.