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

Question: how to search for HTLC related histories via preimage hash and/or HTLC ID? #1739

Closed
abitmore opened this issue Apr 27, 2019 · 6 comments
Assignees
Labels
0 Question Notification that Issue has an open question. Please reference open question within Description

Comments

@abitmore
Copy link
Member

Once an HTLC is redeemed or expired in BitShares blockchain, it's hard to search for related activities via API. Is it easy to search in ElasticSearch? If yes, how?

Use story: as the other party of a HTLC I want an easy way to query for the preimage so I can redeem it in another blockchain.

Also asked here: bitshares/open-explorer#53.

@abitmore abitmore added the 0 Question Notification that Issue has an open question. Please reference open question within Description label Apr 27, 2019
@pmconrad
Copy link
Contributor

Hm, should we add the preimage to htlc_redeemed_operation? Then it would be in the account history of the HTLC creator.

@jmjatlanta
Copy link
Contributor

What happens with very long preimages? I guess if there is a way to handle them on the UI side, that is fine. But is there a storage cost for account history? Should we consider truncating it? Of course then we would need to notify the user that it has been truncated.

Would we try to be smart and display it as a string, unless there are unprintable characters? Perhaps switch to a hex string if there are?

The block id / transaction id would be a good alternative, but they are not known until later.

@pmconrad
Copy link
Contributor

Preimages pay a per-kb fee, so storage cost should be covered.

Representation as usual, i. e. hex string for vector<char>. Trying to be smart only leads to confusion.

@jmjatlanta
Copy link
Contributor

Added as part of BSIP 64. See #1998

@abitmore abitmore added this to To do in Protocol Upgrade Release (4.0.0) via automation Apr 22, 2020
@abitmore abitmore moved this from To do to In development in Protocol Upgrade Release (4.0.0) Apr 22, 2020
@abitmore
Copy link
Member Author

#1998 doesn't actually fix this. The preimage doesn't get stored into the preimage field added in htlc_redeemed_operation. Need new code.

@abitmore
Copy link
Member Author

abitmore commented May 1, 2020

Fixed in #2161.

@abitmore abitmore closed this as completed May 1, 2020
Protocol Upgrade Release (4.0.0) automation moved this from In development to Done May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 Question Notification that Issue has an open question. Please reference open question within Description
Projects
No open projects
Development

No branches or pull requests

3 participants