-
Notifications
You must be signed in to change notification settings - Fork 208
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
10387 simple transaction feed for Fast USDC #10452
Conversation
Deploying agoric-sdk with Cloudflare Pages
|
* @param {CctpTxEvidence} evidence | ||
*/ | ||
makeTestPushInvitation(evidence) { | ||
return zcf.makeInvitation( |
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.
Maybe we can try without an actual invitation, just a method call?
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.
That's how Patrick's PR already works. The point of this PR is so the CLI can push evidence. That can only be done through an offer through the smart wallet
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 was thinking more about the workaround we discussed where the smart wallet would invoke the invitation maker, but the invitation maker itself would just throw without returning an invitation. To avoid the perf overhead of zoe. We'd still want this exo for managing oracle members and aggregating submissions
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 was thinking more about the workaround we discussed where the smart wallet would invoke the invitation maker,
I see. I'll give that a try.
2727135
to
c5b5932
Compare
return zone.exoClassKit('Fast USDC Feed', undefined, () => ({}), { | ||
admin: { | ||
/** @param {CctpTxEvidence } evidence */ | ||
addEvidence: evidence => { |
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.
Is submitEvidence
or reportEvidence
more fitting? Or maybe adopt the push
verb from pushPrice
and call this pushEvidence
?
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.
"submit" sgtm, like submit for evaluation. push
was ambiguous about how it would be aggregated.
/** @type {PublishKit<CctpTxEvidence>} */ | ||
const { publisher, subscriber } = makePublishKit(); | ||
|
||
return zone.exoClassKit('Fast USDC Feed', 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.
consider a guard that uses CctpTxEvidenceShape
/** @param {CctpTxEvidence } evidence */ | ||
addEvidence: evidence => { | ||
trace('TEMPORARY: Add evidence:', evidence); | ||
// TODO decentralize |
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:
- basic validation checks for things that can't be verified by the guard, like address parameter
- and/or, a TODO explaining what validation checks will be performed
void observeIteration(subscribeEach(feedKit.public.getEvidenceStream()), { | ||
updateState(evidence) { | ||
try { | ||
advancer.handleTransactionEvent(evidence); | ||
} catch (err) { | ||
trace('🚨 Error handling transaction event', err); | ||
} | ||
}, | ||
}); |
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, first time seeing this API. Surprised the second argument doesn't need to be a remotable, but that's convenient here.
Are there scenarios where we'd hid the fail
or finish
handlers and need to resubscribe?
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.
Good questions. It may need to be durable but that's for Milestone 2.
If the stream dies, I don't think resubscribing would be safe. It's an unhandled rejection that will need a Core Eval to repair.
* @param {CctpTxEvidence} evidence | ||
*/ | ||
async makeTestPushInvitation(evidence) { | ||
await feedKit.admin.addEvidence(evidence); |
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.
Recognize this is a test method, but why change state in the invitationMaker
instead of the offerHandler
? If addEvidence
were to throw, will smart-wallet get the error message?
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 change state in the invitationMaker instead of the offerHandler
If addEvidence were to throw, will smart-wallet get the error message?
Good question. The throw would happen on this line so it would be an IMMEDIATE_OFFER_ERROR and show up as an error in the wallet status.
I added a todo to test that when we integrate with smart-wallet in bootstrap tests
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.
Ok cool, I see now.
I added a todo to test that when we integrate with smart-wallet in bootstrap tests
🙏
setJig: jig => { | ||
jig.chainHub.registerChain('osmosis', fetchedChainInfo.osmosis); | ||
}, |
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, great approach for now. We'll need to revisit in a future milestone when we do bootstrap and multichain testing.
return zcf.makeInvitation(async cSeat => { | ||
trace('Offer made on noop invitation'); | ||
cSeat.exit(); | ||
return 'noop; evidence was pushed in the invitation maker call'; |
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 using undefined
, as we've adopted this as the return value for many offers. This might help keep muscle-memory fresh for recognizing result: undefined
as a happy path offer result.
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 the return value for many offers
That makes sense for offers that get used, but this one is not supposed to be used. So it should be conspicuously different.
1de9a54
to
8eb7dee
Compare
*/ | ||
|
||
const trace = makeTracer('TxFeed', true); | ||
|
||
export const INVITATION_MAKERS_DESC = 'transaction oracle invitation'; |
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 more global name (wrt fusdc) since we're exporting
closes: #10387
Description
A basic transaction feed component. It has a public invitation maker that isn't for production but will work for contract tests as Advancer and Settle are built.
Security Considerations
Scaling Considerations
Documentation Considerations
Testing Considerations
Upgrade Considerations