Skip to content

feat(network): [NET-1473] PlumTree can now be enabled from the sdk#3147

Merged
juslesan merged 11 commits intomainfrom
NET-1473
Jun 12, 2025
Merged

feat(network): [NET-1473] PlumTree can now be enabled from the sdk#3147
juslesan merged 11 commits intomainfrom
NET-1473

Conversation

@juslesan
Copy link
Copy Markdown
Contributor

@juslesan juslesan commented Jun 9, 2025

Summary

It is now possible to enable the PlumTree optimization from the SDK.

Changes

  • renamed plumTreeOptimisation to plumtreeOptimization

Future Improvements

  • Perhaps NetworkNode#broadcast should not automatically join streams. Instead when a message is published From the SDK for the first time joinStreamPart should be called separately.
  • Handle situation where user creates multiple subscriptions to the same stream part with mismatching delivery options. An error could be thrown, for example.
  • Rename files in trackerless-network/src/content-delivery-layer/plum-tree to be in line with the plumtreeOptimization naming convention refactor(network): rename PlumTree to Plumtree #3150

@juslesan juslesan requested review from Copilot, harbu and teogeb June 9, 2025 11:40
@linear
Copy link
Copy Markdown

linear Bot commented Jun 9, 2025

@github-actions github-actions Bot added network Related to Network Package sdk labels Jun 9, 2025

This comment was marked as outdated.

Copy link
Copy Markdown
Contributor

@teogeb teogeb left a comment

Choose a reason for hiding this comment

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

First round of comments. A changelog should be added.

Comment thread packages/sdk/src/subscribe/Subscription.ts Outdated
Comment thread packages/sdk/src/subscribe/SubscriptionSession.ts Outdated
Comment thread packages/sdk/src/StreamrClient.ts
@juslesan juslesan requested a review from teogeb June 10, 2025 09:48
Comment thread packages/sdk/src/StreamrClient.ts
Comment thread packages/sdk/src/subscribe/SubscriptionSession.ts
Comment thread packages/sdk/src/StreamrClient.ts
@juslesan juslesan requested review from Copilot and harbu June 11, 2025 13:41
@github-actions github-actions Bot added the docs label Jun 11, 2025
Copy link
Copy Markdown
Contributor

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 enables PlumTree optimization via the SDK and standardizes related naming and API signatures. Key changes include:

  • Renaming parameters from "plumTreeOptimisation" to "plumtreeOptimization" for consistency.
  • Updating API signatures and test call sites to support an optional deliveryOptions parameter.
  • Modifying exports and client methods in both network and SDK packages to accommodate these changes.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/trackerless-network/test/utils/utils.ts Renamed parameter for consistent naming.
packages/trackerless-network/src/exports.ts Updated exports to include StreamPartDeliveryOptions.
packages/trackerless-network/src/content-delivery-layer/createContentDeliveryLayerNode.ts Renamed parameter and updated PlumTreeManager instantiation.
packages/trackerless-network/src/ContentDeliveryManager.ts Renamed parameter and updated usage in configuration.
packages/sdk/test/unit/resendSubscription.test.ts, SubscriptionSession.test.ts Adjusted Subscription instantiation with updated parameter order.
packages/sdk/src/utils/addStreamToStorageNode.ts Inserted an explicit undefined to maintain parameter consistency.
packages/sdk/src/subscribe/SubscriptionSession.ts Updated the join call to include deliveryOptions from subscriptions.
packages/sdk/src/subscribe/Subscription.ts Introduced a new deliveryOptions property in Subscription.
packages/sdk/src/publish/Publisher.ts Extended publish signature to pass deliveryOptions to broadcast.
packages/sdk/src/exports.ts Exported updated types to support delivery options.
packages/sdk/src/StreamrClient.ts Updated publish and join methods to support the new parameter.
packages/sdk/src/NetworkNodeFacade.ts Modified join and broadcast signatures to include deliveryOptions.
CHANGELOG.md Documented the new support for plumtree optimization.
Comments suppressed due to low confidence (1)

packages/sdk/src/NetworkNodeFacade.ts:226

  • The updated join (and broadcast) method signatures now include an optional deliveryOptions parameter. Please verify that these changes are backward compatible with external consumers relying on the previous API contract.
async join(streamPartId: StreamPartID, neighborRequirement?: { minCount: number, timeout: number }, deliveryOptions?: StreamPartDeliveryOptions): Promise<void> {

Comment thread packages/sdk/src/subscribe/SubscriptionSession.ts
Comment thread CHANGELOG.md Outdated
- Add new storage node address `STREAMR_STORAGE_NODE_ADDRESS` (https://github.com/streamr-dev/network/pull/3020)
- Add `peaq` environment (https://github.com/streamr-dev/network/pull/3111)
- Add `iotex` environment (https://github.com/streamr-dev/network/pull/3142)
- Add support for using the plumtree optimisation in stream partitions in the SDK (https://github.com/streamr-dev/network/pull/3147)
Copy link
Copy Markdown
Contributor

@harbu harbu Jun 11, 2025

Choose a reason for hiding this comment

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

Something weird going on here or my github diff view is broken. This should be the only item in "unreleased" as v103 was pushed yesterday. Maybe merge gone wrong?

Copy link
Copy Markdown
Contributor Author

@juslesan juslesan Jun 11, 2025

Choose a reason for hiding this comment

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

@teogeb the changes to the changelist are under "unreleased" here

Copy link
Copy Markdown
Contributor

@teogeb teogeb left a comment

Choose a reason for hiding this comment

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

The changelog item should be under "Unreleased" section, otherwise ok 👍

juslesan added a commit that referenced this pull request Jun 11, 2025
## Summary

Renamed PlumTree to Plumtree to match naming of the configuration in
#3147
@juslesan juslesan merged commit 6434f31 into main Jun 12, 2025
24 checks passed
@juslesan juslesan deleted the NET-1473 branch June 12, 2025 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs network Related to Network Package sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants