Skip to content

feat: cache SHA3-384 entries#298

Open
upils wants to merge 5 commits into
canonical:mainfrom
upils:cache-bins
Open

feat: cache SHA3-384 entries#298
upils wants to merge 5 commits into
canonical:mainfrom
upils:cache-bins

Conversation

@upils
Copy link
Copy Markdown
Collaborator

@upils upils commented May 22, 2026

  • Have you signed the CLA?

The Binstore only publishes SHA3-384 hashes for bins. This PR enables storing entries in the cache using
SHA3-384 hashes. Consumers of the cache package must now explicitly select the algorithm to
be used to create/write/read an entry.

@upils upils requested a review from Copilot June 1, 2026 12:56
Copy link
Copy Markdown

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR extends the internal cache to support multiple hashing algorithms (SHA-256 and SHA3-384) and updates callers/tests to specify which algorithm to use.

Changes:

  • Introduced hashAlgo with SHA-256 and SHA3-384 support, plus hash construction via newHash.
  • Updated cache APIs (Create, Write, Open, Read) to take an algorithm parameter and adjusted archive fetch code accordingly.
  • Added a test verifying SHA3-384 entries are isolated from SHA-256 entries.

Reviewed changes

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

File Description
internal/cache/cache.go Adds multi-algorithm hashing support, updates cache APIs, and expires entries across algorithm directories.
internal/cache/cache_test.go Updates tests to pass the algorithm and adds SHA3-384 isolation coverage.
internal/archive/archive.go Updates cache usage in archive fetch path to specify SHA-256 algorithm.

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

Comment thread internal/cache/cache.go
Comment thread internal/cache/cache.go
Comment thread internal/cache/cache.go
Comment thread internal/cache/cache.go
Comment thread internal/cache/cache.go
upils added 3 commits June 1, 2026 16:06
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
Signed-off-by: Paul Mars <paul.mars@canonical.com>
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