-
Notifications
You must be signed in to change notification settings - Fork 53
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
feat: messageHash attribute added in SQLite + testcase #2142
Conversation
This PR may contain changes to database schema of one of the drivers. If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues. Please make sure the label |
You can find the image built from this PR at
Built from 2efab14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! It is getting a look shape. However, I have the impression that we need to properly implement the computeDeterministicMessageHash
proc, as I mentioned in a comment.
@(digest.data), # id | ||
@(digest.data), # messageHash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe there is something that I'm missing but messageHash
looks the same as id
.
I think we need to create a new computeDeterministicMessageHash
proc in waku_archive.nim
where we create the following attribute: https://rfc.vac.dev/spec/14/#deterministic-message-hashing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, as per the initial approach, we aim to remove the id
attribute and replace it with messageHash
, as not only nomenclature is better but the way digest/hash is computed it makes sense.
the computation logic behind messageHash
follows the RFC. The digest logic is implemented in the previous PR for the same base issue #2112
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely right that we have it implemented. I got confused because we have another computeDigest
definition, which is different. We need to revisit it and check if we can only use one.
nwaku/waku/waku_store/common.nim
Line 30 in 817a7b2
proc computeDigest*(msg: WakuMessage): MessageDigest = |
@jm-clius - something that I realized while reviewing this PR is that the messageHash won't be unique and therefore we need to also consider the |
Well, the problem with |
Co-authored-by: Ivan FB <[email protected]>
This reverts commit 9cd8c73.
This reverts commit 9cd8c73.
* feat: messageHash attaribute added in SQLite + testcase * Update tests/waku_archive/test_driver_sqlite_query.nim Co-authored-by: Ivan FB <[email protected]> --------- Co-authored-by: Ivan FB <[email protected]>
…org#2142)" (waku-org#2154) This reverts commit 9cd8c73.
Description
messageHash
attributed added to SQLite, which aims to remove theid
attribute in upcoming PRs. An associated test case also added.migration scripts will be changed after the deletion of
id
attribute in upcoming PRs.Changes
messageHash
attribute addedmessageHash
attributeIssue
#2112