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

feat: protobuf-es #1245

Closed
wants to merge 7 commits into from
Closed

feat: protobuf-es #1245

wants to merge 7 commits into from

Conversation

danisharora099
Copy link
Collaborator

@danisharora099 danisharora099 commented Mar 16, 2023

Problem

#335

@github-actions
Copy link

github-actions bot commented Mar 16, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku core 132.73 KB (+13.71% 🔺) 2.7 s (+13.71% 🔺) 471 ms (+56.95% 🔺) 3.2 s
Waku default setup 403.05 KB (+4.96% 🔺) 8.1 s (+4.96% 🔺) 862 ms (+28.45% 🔺) 9 s
ECIES encryption 27.42 KB (-2.04% 🔽) 549 ms (-2.04% 🔽) 148 ms (-19.52% 🔽) 696 ms
Symmetric encryption 26.7 KB (-4.62% 🔽) 534 ms (-4.62% 🔽) 104 ms (-31.2% 🔽) 638 ms
DNS discovery 108.07 KB (0%) 2.2 s (0%) 298 ms (-22.24% 🔽) 2.5 s
Privacy preserving protocols 132.74 KB (+14.22% 🔺) 2.7 s (+14.22% 🔺) 253 ms (-28.78% 🔽) 3 s
Light protocols 132.75 KB (+12.52% 🔺) 2.7 s (+12.52% 🔺) 519 ms (+42.64% 🔺) 3.2 s
History retrieval protocols 132.74 KB (+12.44% 🔺) 2.7 s (+12.44% 🔺) 535 ms (+122.31% 🔺) 3.2 s

@@ -32,7 +20,7 @@ export interface IMessage {
}

export interface IMetaSetter {
(message: IProtoMessage & { meta: undefined }): Uint8Array;
(message: proto_message.WakuMessage & { meta: undefined }): Uint8Array;
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe have a type IProtoMessage = proto_message.WakuMessage and re-export it. Less changes across the code base and fair to make the type easier to access

@@ -42,7 +37,7 @@ export type StoreQueryOptions = {
* Cursor as an index to start a query from. Must be generated from a Waku
* Message.
*/
cursor?: Cursor;
cursor?: proto_store.Index;
Copy link
Collaborator

@fryorcraken fryorcraken Mar 16, 2023

Choose a reason for hiding this comment

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

I don't think we should expose proto class to the user. We should keep the Cursor interface.

@@ -1,4 +1,4 @@
import { IProtoMessage } from "@waku/interfaces";
import { proto_message } from "@waku/proto";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good reason to re-export proto_message.WakuMessage from @waku/interfaces as IProtoMessage.

Comment on lines +38 to +42
rateLimitProof: undefined,
timestamp: undefined,
meta: undefined,
version: undefined,
ephemeral: undefined,
Copy link
Collaborator

Choose a reason for hiding this comment

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

not needed anymore

Comment on lines +49 to +51
"@bufbuild/buf": "^1.15.0-1",
"@bufbuild/protobuf": "^1.1.1",
"@bufbuild/protoc-gen-es": "^1.1.1"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assumed two of these deps are devDependencies, no?

@@ -53,6 +53,7 @@
"@libp2p/interface-peer-discovery": "^1.0.5",
"@libp2p/interfaces": "^3.3.1",
"@waku/enr": "*",
"@waku/interfaces": "*",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why? it should only contain types and hence remain a devDepedencies item

@@ -1,3 +1,4 @@
import { PeerExchangeQueryParams } from "@waku/interfaces";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
import { PeerExchangeQueryParams } from "@waku/interfaces";
import type { PeerExchangeQueryParams } from "@waku/interfaces";

@fryorcraken
Copy link
Collaborator

Waku core 132.73 KB (+13.71% small_red_triangle) 2.7 s (+13.71% small_red_triangle) 1.7 s (+90.35% small_red_triangle) 4.3 s

Boom, 13% size increase

@danisharora099
Copy link
Collaborator Author

#335 (comment)

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.

2 participants