Skip to content
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

Report swingset actions result for client tools to get cosmos tx outcome #7148

Open
michaelfig opened this issue Mar 9, 2023 · 5 comments
Open
Assignees
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request vaults_triage DO NOT USE

Comments

@michaelfig
Copy link
Member

What is the Problem Being Solved?

Promise rejections or fulfilments for bridge actions are not exposed to the user of the chain.

Description of the Design

When the bridge handler’s return promise fulfills/rejects we should publish a Cosmos event indexed by txHash and msgIdx, so that off-chain clients (like the wallet UI) have a way to query an RPC node for historical settlements or watch for future ones.

Security Considerations

Scaling Considerations

Test Plan

@michaelfig michaelfig added enhancement New feature or request cosmic-swingset package: cosmic-swingset labels Mar 9, 2023
@mhofman
Copy link
Member

mhofman commented Mar 9, 2023

See #7102 which will plumb the txHash and msgIdx from cosmos to cosmic-swingset.

Right now a bridge delivery that cosmic-swingset performs has no return path (as it's implemented using swingset devices) but a specific mechanism could be introduced, or the context could be sent into vat-bridge alongside the action, and vat-bridge would publish the result itself. Either case this would be bridge specific logic, the question is mostly which side of the bridge triggers publishing (vat or cosmic-swingset).

@mhofman
Copy link
Member

mhofman commented Aug 24, 2023

Bridge actions may not be the only actions that submitters are interested in. For example publish bundles are in need of a similar tracking mechanism.

@mhofman
Copy link
Member

mhofman commented Aug 24, 2023

After chatting with @michaelfig, my understanding is that we want to leverage cosmos Events for this mechanism which avoid the storage cost of keeping historical results in storage. However cosmos Events are not in consensus, and that's what "append" vstorage nodes with notifications are meant to solve.

The strawman would be to have 2 vstorage nodes, e.g. swingsetActionStart and swingetActionResult, which are written to with "append" mode from cosmic-swingset. This generates change events for which the client can subscribe to.

@michaelfig also notes:

If we exposed a mechanism via chainStorage that also allowed attaching arbitrary event key/values to the state change event, we could use them for efficient subscription.

I assume we'd want things like the txHash to be an event attribute so that clients can filter the event stream accordingly (I don't know how this works). It strikes me we may want to work with block explorers to support and index these events and show this information attached to Transaction details.

The result value would be message specific, but in some cases like wallet actions, it may make sense to reference a vstorage node containing more details about the wallet action result.

@mhofman
Copy link
Member

mhofman commented Aug 30, 2023

Note that the bridge mechanism that reports errors to cosmic-swingset should be durable to that a transaction spanning an upgrade of the vat where the bridge handler lives will still get its status reported correctly

@mhofman mhofman changed the title Publish settlement of bridge handlers as a Cosmos event Report swingset actions result for client tools to get cosmos tx outcome Nov 10, 2023
@mhofman
Copy link
Member

mhofman commented Nov 10, 2023

#8441 discusses the bridge reporting side.

The tools can be command line, but likely we want explorers to be updated with support for lookup of tx outcome as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request vaults_triage DO NOT USE
Projects
None yet
Development

No branches or pull requests

3 participants