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

fix(store)!: use pubSubTopic from DecodedMessage for createCursor #1640

Merged
merged 3 commits into from
Oct 9, 2023

Conversation

danisharora099
Copy link
Collaborator

Problem

For Store protocol, DecodedMessage/Decoder as well as createCursor take in pubSubTopic while only the former is treated as the source of truth when using it.

Solution

Since DecodedMessage now always has PubSubTopic, we can abstract away setting it from the API to library consumers.

@danisharora099 danisharora099 changed the title fix!(store): use pubSubTopic from DecodedMessage for createCursor chore!(store): use pubSubTopic from DecodedMessage for createCursor Oct 9, 2023
@danisharora099 danisharora099 changed the title chore!(store): use pubSubTopic from DecodedMessage for createCursor fix(store)!: use pubSubTopic from DecodedMessage for createCursor Oct 9, 2023
@danisharora099 danisharora099 marked this pull request as ready for review October 9, 2023 07:45
@danisharora099 danisharora099 requested a review from a team as a code owner October 9, 2023 07:45
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 27.74 KB (-0.47% 🔽) 555 ms (-0.47% 🔽) 1.8 s (+20.29% 🔺) 2.3 s
Waku Simple Light Node 262.91 KB (+0.01% 🔺) 5.3 s (+0.01% 🔺) 5.1 s (+8.75% 🔺) 10.4 s
ECIES encryption 29.58 KB (-0.45% 🔽) 592 ms (-0.45% 🔽) 2 s (-3.96% 🔽) 2.6 s
Symmetric encryption 29.59 KB (-0.45% 🔽) 592 ms (-0.45% 🔽) 1.9 s (+10.51% 🔺) 2.5 s
DNS discovery 110.58 KB (-0.12% 🔽) 2.3 s (-0.12% 🔽) 3.9 s (+25.5% 🔺) 6.1 s
Privacy preserving protocols 117.31 KB (0%) 2.4 s (0%) 3.4 s (+5.04% 🔺) 5.7 s
Light protocols 25.89 KB (-0.47% 🔽) 518 ms (-0.47% 🔽) 1.9 s (+20.86% 🔺) 2.4 s
History retrieval protocols 25.09 KB (-0.36% 🔽) 502 ms (-0.36% 🔽) 2 s (+46.33% 🔺) 2.5 s
Deterministic Message Hashing 5.65 KB (0%) 113 ms (0%) 576 ms (+17.22% 🔺) 689 ms

Copy link
Collaborator

@fryorcraken fryorcraken left a comment

Choose a reason for hiding this comment

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

This does not fix the whole problem. does it?

A cursor passed to a store API might still have a different pubsubtopic that the IDecoder if the developer makes a mistake and cross their wires.

@danisharora099
Copy link
Collaborator Author

This does not fix the whole problem. does it?

A cursor passed to a store API might still have a different pubsubtopic that the IDecoder if the developer makes a mistake and cross their wires.

Good point. Also added an if condition to check that the pubsub topic from Decoder should match the one in Cursor

@danisharora099 danisharora099 merged commit b10c46b into master Oct 9, 2023
@danisharora099 danisharora099 deleted the fix/store-cursor-pubsubtopic branch October 9, 2023 15:55
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

Successfully merging this pull request may close these issues.

3 participants