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

Adds simple indexing to qgb module #246

Merged

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Mar 14, 2022

Uses index prefix to query for commitments.

Adds to: #241

Currently, the keys are as follows:

return DataCommitmentConfirmKey + commitment + string(validator.Bytes())

@rach-id rach-id self-assigned this Mar 14, 2022
@rach-id rach-id changed the base branch from master to qgb-integration March 14, 2022 12:46
@evan-forbes
Copy link
Member

evan-forbes commented Mar 14, 2022

Indexing by commitment is useful, but it might be even more useful to index by nonce instead, mainly because we wouldn't have to generate the commitment before querying.

Specifically, I could see this being useful for both celestiaorg/blobstream-contracts#54 and #332

@evan-forbes
Copy link
Member

we can keep this the way it is now though, just something to think about

@rach-id
Copy link
Member Author

rach-id commented Mar 14, 2022

What is a nonce for a data commitment message?

@evan-forbes
Copy link
Member

evan-forbes commented Mar 14, 2022

What is a nonce for a data commitment message?

We don't have a nonce yet for the data commitment, but we will need one once this is expected by the contracts, and will make slashing easier. Currently the mvp relayer just generates the nonce, but that's not ideal.

edit: added an issue #248 . Definitely something we refactor later

Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will speed up the mvp relayer queries significantly! thanks for this @sweexordious

two 👍 👍

@rach-id rach-id merged commit df46d12 into celestiaorg:qgb-integration Mar 14, 2022
@rach-id rach-id deleted the adds_simple_indexing_to_qgb_module branch March 14, 2022 17:52
rach-id added a commit to rach-id/celestia-app that referenced this pull request May 9, 2022
* use index prefix for commitments query

* adds test for indexed query

* linter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants