Skip to content

feat!: re-work messaging parts and sharding #2399

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

Merged
merged 6 commits into from
Jun 3, 2025
Merged

Conversation

weboko
Copy link
Collaborator

@weboko weboko commented May 31, 2025

Description

Due to root message related types (i.e IDecodedMessage) we incur some inefficiency and lack of needed properties.

Proposed Solution / Feature Design

We need to do couple of things to hide complexity of types and make them more consumer firendly:

  • remove not needed proto package on interfaces;
  • move message-encryption to core package;
  • ensure types of decoders are used;

Notes


Checklist

  • Code changes are covered by unit tests.
  • Code changes are covered by e2e tests, if applicable.
  • Dogfooding has been performed, if feasible.
  • A test version has been published, if required.
  • All CI checks pass successfully.

@Copilot Copilot AI review requested due to automatic review settings May 31, 2025 14:00
@weboko weboko requested a review from a team as a code owner May 31, 2025 14:00
@weboko weboko changed the title Weboko/enc dec 2 feat!: re-work messaging parts and sharding May 31, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the standalone message-hash package by merging its functionality into core, introduces a messageHashStr convenience wrapper with accompanying tests, and updates encryption decoders/interfaces to use a new IEncryptedMessage type.

  • Remove packages/message-hash and update workspaces/manifests
  • Merge messageHash (+ new messageHashStr) into core and extend test coverage
  • Update encryption decoders and shared interfaces to use IEncryptedMessage

Reviewed Changes

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/message-hash/** Removed obsolete standalone message-hash package files
packages/core/src/lib/message_hash/message_hash.ts Added messageHashStr and updated documentation comments
packages/core/src/lib/message_hash/message_hash.spec.ts Renamed suite and added tests for messageHashStr
packages/interfaces/src/message.ts Introduced IEncryptedMessage, cleaned up duplicate definitions
packages/message-encryption/src/symmetric.ts,
ecies.ts,
decoded_message.ts
Updated decoders to return IEncryptedMessage
packages/core/src/index.ts Exported messageHash and messageHashStr from core entry
.size-limit.cjs Updated size-limit path to point at core bundle
package.json,
.release-please-manifest.json
Removed message-hash package references
Comments suppressed due to low confidence (2)

.size-limit.cjs:62

  • The path field is now an array, but size-limit typically expects a string. Verify that this syntax is supported or change back to a string to prevent configuration errors.
    path: ["packages/core/bundle/index.js"],

packages/core/src/index.ts:24

  • [nitpick] You've exposed messageHashStr at the core entrypoint, but the top-level README or public documentation hasn't been updated to mention this new API. Consider adding usage examples to keep docs in sync.
export { messageHash, messageHashStr } from "./lib/message_hash/index.js";

Copy link

github-actions bot commented May 31, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 63.45 KB (+0.17% 🔺) 1.3 s (+0.17% 🔺) 10.1 s (+0.14% 🔺) 11.4 s
Waku Simple Light Node 117.21 KB (+0.12% 🔺) 2.4 s (+0.12% 🔺) 10 s (-14.59% 🔽) 12.4 s
ECIES encryption 23.06 KB (-0.29% 🔽) 462 ms (-0.29% 🔽) 4 s (+5.36% 🔺) 4.4 s
Symmetric encryption 22.52 KB (-0.04% 🔽) 451 ms (-0.04% 🔽) 3.5 s (+77.36% 🔺) 4 s
DNS discovery 50.75 KB (0%) 1.1 s (0%) 6.1 s (+27.11% 🔺) 7.1 s
Peer Exchange discovery 51.13 KB (0%) 1.1 s (0%) 5.2 s (-44.29% 🔽) 6.2 s
Local Peer Cache Discovery 44.49 KB (0%) 890 ms (0%) 4.3 s (-6.89% 🔽) 5.2 s
Privacy preserving protocols 52.02 KB (+0.08% 🔺) 1.1 s (+0.08% 🔺) 7.5 s (+23.37% 🔺) 8.5 s
Waku Filter 54.05 KB (-0.05% 🔽) 1.1 s (-0.05% 🔽) 5.5 s (+12.92% 🔺) 6.5 s
Waku LightPush 51.37 KB (0%) 1.1 s (0%) 6.8 s (+21.12% 🔺) 7.8 s
History retrieval protocols 51.63 KB (0%) 1.1 s (0%) 6 s (-7.42% 🔽) 7 s
Deterministic Message Hashing 16.03 KB (+120.16% 🔺) 321 ms (+120.16% 🔺) 3.5 s (+162.59% 🔺) 3.8 s

@weboko weboko force-pushed the weboko/enc-dec-2 branch from 86c3c02 to 2642c54 Compare May 31, 2025 14:09
Copy link
Member

@adklempner adklempner left a comment

Choose a reason for hiding this comment

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

LGTM

@weboko weboko merged commit 1905558 into master Jun 3, 2025
11 checks passed
@weboko weboko deleted the weboko/enc-dec-2 branch June 3, 2025 09:08
@weboko weboko mentioned this pull request May 30, 2025
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.

feat: improve messaging types and sharding
2 participants