Skip to content

Conversation

@n8mgr
Copy link
Member

@n8mgr n8mgr commented Nov 28, 2025

@github-project-automation github-project-automation bot moved this to In Progress in Sia Nov 28, 2025
@socket-security
Copy link

socket-security bot commented Nov 28, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgo.sia.tech/​coreutils@​v0.18.7 ⏵ v0.19.098100100100100
Updatedgo.sia.tech/​core@​v0.18.1 ⏵ v0.19.099 +1100100100100

View full report

Copy link

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 adds support for caching subtree Merkle roots in the database to optimize disk I/O when reading partial sectors. By storing precalculated subtree roots, the system can read only the required segment of a sector instead of the entire sector when generating Merkle proofs, significantly reducing disk I/O operations.

Key changes:

  • Adds cached_subtree_roots column to stored_sectors table for storing Merkle subtree roots
  • Modifies ReadSector to return partial sector data with Merkle proofs using cached subtrees
  • Updates contract storage proof generation to use the new optimized sector reading

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
persist/sqlite/init.sql Adds cached_subtree_roots BLOB column to stored_sectors table
persist/sqlite/migrations.go Adds migration v46 to add cached_subtree_roots column
persist/sqlite/sectors.go Implements CacheSubtrees and SectorMetadata methods for persistence
host/storage/persist.go Defines interface for CacheSubtrees and SectorMetadata methods
host/storage/storage.go Implements optimized sector reading with subtree caching logic
host/storage/volume.go Modifies ReadSector to support partial reads with offset and length
host/contracts/update.go Updates storage proof building to use new ReadSector signature
host/contracts/manager.go Updates StorageManager interface with new ReadSector signature
api/api.go Updates interface definition and removes unused import
api/volumes.go Updates sector verification to use new ReadSector signature
host/storage/storage_test.go Updates tests to use new ReadSector signature, removes obsolete TestSectorCache
internal/integration/rhp/v4/rhp4_test.go Improves error checking and adds logging
go.mod, go.sum Updates dependencies to core v0.19.0 and coreutils v0.19.0

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

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@n8mgr n8mgr force-pushed the nate/partial-reads branch 2 times, most recently from 1eaa738 to 197941b Compare December 1, 2025 17:31
@n8mgr n8mgr force-pushed the nate/partial-reads branch from 197941b to 47c97ce Compare December 1, 2025 17:32
Copy link
Member

@peterjan peterjan left a comment

Choose a reason for hiding this comment

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

The LRU cache on the volume manager seems completely redundant now?

@n8mgr n8mgr merged commit 29455a2 into master Dec 2, 2025
13 checks passed
@n8mgr n8mgr deleted the nate/partial-reads branch December 2, 2025 17:54
@github-project-automation github-project-automation bot moved this from In Progress to Done in Sia Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants