This repository has been archived by the owner on Jun 14, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What happens if we have another message with same contentTopic and payload but different topic or timestamp?
E.g. if I write "hello" in payload field at three different times over the same contentTopic
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.
I know that index comparison is done on both timestamp and digest. Does this mean that digest clashes are expected?
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.
@oskarth
afaik, in the current implementation we are using one pubsub topic, right?
But if there would be more than one pubsub topic, then the two waku messages despite being published on distinct pubsub topics will be considered identical and will result in the same hash. But, it does not mean that only one of them gets to live! they both get stored. The hash output is only for the sake of pagination.
Also recall that we also make use of timestamp (not in the digest computation) to resolve ties. Timestamp is part of the index of a waku message and has a higher priority in the comparison of indexed waku messages than the message digest.
@jm-clius
Yes, that is true for messages with identical payload and content topic. But the timestamp part would resolve the tie.
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.
Aight, with timestamp as well we should be fine then, thanks!