Skip to content

Conversation

@gaius-qi
Copy link
Member

@gaius-qi gaius-qi commented Dec 5, 2025

Description

This pull request adds support for two new packet types—DownloadPersistentPiece and PersistentPieceContent—to the Vortex protocol, updating both the core implementation and documentation. It also introduces comprehensive benchmarking and tests for these new types, ensuring they are handled consistently throughout the codebase.

Protocol and Documentation Updates:

  • Added DownloadPersistentPiece (Tag=0x02) and PersistentPieceContent (Tag=0x03) to the protocol, and updated the documentation (docs/README.md) to reflect the new tag assignments and descriptions. Existing tags have been shifted accordingly to maintain consistency. [1] [2]

Core Implementation:

  • Introduced new variants in the Vortex enum for DownloadPersistentPiece and PersistentPieceContent, and updated all relevant methods (such as id, tag, length, header, serialization, and deserialization) to handle these new types. [1] [2] [3] [4] [5] [6] [7]
  • Added two new header constructors: new_download_persistent_piece and new_persistent_piece_content for generating appropriate headers for the new packet types. [1] [2]

Benchmarking Enhancements:

  • Added benchmarks for creation, serialization, and deserialization of DownloadPersistentPiece and PersistentPieceContent packets in benches/vortex.rs to ensure performance is tracked for the new types. [1] [2] [3] [4]

Testing:

  • Added a unit test for converting a DownloadPersistentPiece packet to bytes, ensuring correct serialization.

Versioning:

  • Bumped crate version from 0.1.4 to 0.1.5 in Cargo.toml to reflect the protocol and API changes.

Related Issue

Motivation and Context

Screenshots (if appropriate)

Signed-off-by: Gaius <gaius.qi@gmail.com>
Signed-off-by: Gaius <gaius.qi@gmail.com>
@gaius-qi gaius-qi self-assigned this Dec 5, 2025
@gaius-qi gaius-qi added the enhancement New feature or request label Dec 5, 2025
@gaius-qi gaius-qi enabled auto-merge (squash) December 5, 2025 09:59
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@gaius-qi gaius-qi merged commit f426128 into main Dec 5, 2025
5 checks passed
@gaius-qi gaius-qi deleted the feature/persistent-task branch December 5, 2025 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants