-
Notifications
You must be signed in to change notification settings - Fork 229
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
orchestration transfer() vow should not resolve until the remote chain confirms #9783
Comments
agoric-sdk/packages/vats/src/localchain.js Lines 153 to 166 in 369fa7c
|
A "response" ( A brief segue: here's the Monsterpiece Theatre I acted out for @turadg and @0xpatrickdev when explaining these separate layers: Alice writes a note to Bob, stamps it with a sequence number, and puts the note in her outbox Without #9820: Alice jumps the gun and says: "Message sent! Full speed ahead!" Curtains. With #9820: Ray collects the notes from Alice's outbox, delivers one to Bob's inbox. Bob reads Alice's note, and performs the requested work, however long it may take. Bob puts a reply note to Alice in his outbox, stamped with Alice's sequence number. Ray collects the notes from Bob's outbox, delivers one to Alice's inbox. Alice reads Bob's note, and decides between: Alice says: "Message confirmed! Full speed ahead!" Curtains. |
closes: #9783 ## Description Introduce a per-LOA `packetTools` to grant powers used by IBC-specific `makeIBCReplyKit` and `makeIBCTransferSender` which enables a `localOrchestrationAccount` to send a packet and wait for a corresponding reply packet (such as IBC acknowledgement or IBC timeout) in the context of a single localChainAccount address. The most important files are `agoric-sdk/packages/orchestration/src/exos/packet-tools.js` and `ibc-packet.js` in the same directory. ### Security Considerations This change is the next layer wrapping localchain and vtransfer powers, but in an attenuated fashion. They don't introduce more powers than are already available via `LOA.monitorTransfers(...)`. ### Scaling Considerations More message exchanges, but most of those are caused by inbound Cosmos transactions, so they should not consume much CPU per block. ### Documentation Considerations New API surface. Existing data and deployments will not be affected, especially since the orchestration vat+API has not yet landed on chain. ### Testing Considerations Unit and bootstrap tests have been implemented. The `agoric-sdk/packages/boot/test/supports.ts` fake bridge has been reorganised to greater mimic the actual chain and make tests pass. ### Upgrade Considerations Some more Exos shipped with the Orch API, with the usual considerations of adding new Exo singletons and classKits and maintaining them.
What is the Problem Being Solved?
transfer
method inlocal-orchestration-account.js
returns a vow that returns once the message is put in the outbox. The transfer isn't really complete until the remote chain confirms. Moreover the transfer may fail and in that case the vow should reject.Same goes for
cosmos-orchestration-account.js
but that's "Not yet implemented". I wrote the PR title generically as a product requirement.Description of the Design
Prior art: https://gist.github.com/michaelfig/280acc7d0bb1eb10bf7570929305bb80
Monitor transfers accepts a single “app” / “tap” at a time. If we use it in a platform-level service that watches outgoing transfers and resolves promises, we still need to support developers registering their own handlers. We could use the one slot with a generic handler that calls out to other handlers.
Security Considerations
Scaling Considerations
Test Plan
Upgrade Considerations
The text was updated successfully, but these errors were encountered: