Skip to content

Add ZSTD wrapper library#71

Merged
mateeullahmalik merged 2 commits intomasterfrom
AddZSTDCWRapper
Nov 24, 2025
Merged

Add ZSTD wrapper library#71
mateeullahmalik merged 2 commits intomasterfrom
AddZSTDCWRapper

Conversation

@mateeullahmalik
Copy link
Contributor

@mateeullahmalik mateeullahmalik commented Nov 21, 2025

Copy link
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 migrates from the pure Go klauspost/compress/zstd library to the CGO-based DataDog/zstd library wrapper, which provides bindings to the official C zstd implementation. The change simplifies the compression logic by using direct CompressLevel calls instead of managing encoders.

Key Changes:

  • Replaced klauspost/compress/zstd with DataDog/zstd CGO wrapper
  • Simplified ZstdCompress and HighCompress functions to use direct compression calls
  • Removed multi-threaded compression logic from HighCompress function

Reviewed changes

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

File Description
go.mod Moved github.com/DataDog/zstd v1.5.7 from indirect to direct dependency and moved github.com/klauspost/compress v1.18.0 to indirect dependencies
x/action/v1/keeper/crypto.go Replaced klauspost/compress/zstd with DataDog/zstd, simplified compression functions to use CompressLevel API, removed unused imports (bytes, io, runtime)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@roomote-v0
Copy link

roomote-v0 bot commented Nov 22, 2025

Rooviewer Clock   See task on Roo Cloud

I've reviewed the changes. The HighCompress function now utilizes the semaphore, but the function itself appears to be unused in the codebase. The CGO dependency issue also remains unaddressed.

  • Address CGO dependency concerns in go.mod
  • Clean up unused constants and imports in x/action/v1/keeper/crypto.go
  • Remove or document unused HighCompress function
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

a-ok123 pushed a commit that referenced this pull request Nov 22, 2025
Review covers:
- Code changes analysis
- Critical compatibility concerns with Kademlia ID generation
- Performance impact assessment
- Testing recommendations
- Build and deployment considerations
@mateeullahmalik mateeullahmalik merged commit 21108d8 into master Nov 24, 2025
8 checks passed
@mateeullahmalik mateeullahmalik deleted the AddZSTDCWRapper branch November 26, 2025 20:59
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