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

Accessing swap status after a batch has been processed #427

Open
4 tasks
konnov opened this issue Jun 24, 2021 · 0 comments
Open
4 tasks

Accessing swap status after a batch has been processed #427

konnov opened this issue Jun 24, 2021 · 0 comments
Milestone

Comments

@konnov
Copy link

konnov commented Jun 24, 2021

Summary

It is hard to access the status of a swap (or deposit, or withdrawal) after the corresponding batch has been processed.

Surfaced from @informalsystems audit of v1.2.8.

Problem Definition

The liquidity module allows the user to place swap orders (as well as deposit and withdrawal orders) in the command line. However, once an order has been placed, the status of this order is not shown in the corresponding transaction. Indeed, the orders are processed in a batch. The user can query the order status with gaiad query liquidity swaps <pool-id>. This works until the order is processed within the corresponding batch. There is a very short time window of one block, when the user can observe that the order has been executed. Once the order has been processed, it cannot be found any longer.

This is aggravated by the fact that the orders are processed in EndBlocker and cannot be queried with gaiad query txs. The only working solution (suggested by the team) is to find the block, where the order has been processed, e.g.,

http://localhost:26657/block_search?query=%22swap_transacted.msg_index=%271%27%20AND%20swap_transacted.pool_id=%271%27%22

and then inspect end_block_events by querying http://localhost:26657/block_results?height=....

While this approach works, it makes testing and debugging error-prone. Basically, one has to write a script to retrieve end_block_events, decode base64, etc.

Proposal

Make the status of the orders accessible via the command line interface. As events may be periodically pruned by nodes, it is probably hard to guarantee that the status would be accessible on every node. However, the status could be made accessible without a reasonable time window. Also, it could be accessible on an archival node.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@dongsam dongsam added this to the v2 milestone Jul 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants