Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: mater car reader read_block_metadata #706

Merged
merged 5 commits into from
Jan 29, 2025

Conversation

cernicc
Copy link
Member

@cernicc cernicc commented Jan 28, 2025

Description

Enable mater car readers to be able to read the blocks metadata while reading the car archive. If the read_block_metadata is used, that means that the block content is not loaded into memory and only the block's metadata is returned.

This is needed for the storage provider server for when the sector is being indexed. The provider will index the sectors after they are successfully prove committed. The indexing process opens unesaled sector files and reads the car blocks directly from the file. For indexing purposes, we don't need the content in the block. This pr enables the sector indexer to only read the metadata of the car block and saves that to the index.

Checklist

  • Make sure that you described what this change does.
  • Have you tested this solution?
  • Did you document new (or modified) APIs?

@cernicc cernicc self-assigned this Jan 28, 2025
@cernicc cernicc added the ready for review Review is needed label Jan 28, 2025
@cernicc cernicc added this to the Phase 3 milestone Jan 28, 2025
@cernicc cernicc added ready for review Review is needed and removed ready for review Review is needed labels Jan 28, 2025
Copy link
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

LGTM but there's some things I think could be improved

mater/lib/src/v1/reader.rs Outdated Show resolved Hide resolved
mater/lib/src/cid.rs Show resolved Hide resolved
mater/lib/src/cid.rs Show resolved Hide resolved
@cernicc cernicc requested a review from jmg-duarte January 28, 2025 15:23
@cernicc cernicc added ready for review Review is needed and removed ready for review Review is needed labels Jan 28, 2025
@cernicc cernicc changed the title feat: mater car reader block skipping feat: mater car reader read_block_metadata Jan 28, 2025
Copy link
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

When I grow up, I want to be like you 🚀

@jmg-duarte jmg-duarte enabled auto-merge (squash) January 28, 2025 17:25
@jmg-duarte jmg-duarte merged commit dcf0557 into develop Jan 29, 2025
6 checks passed
@jmg-duarte jmg-duarte deleted the feat/mater-block-reader branch January 29, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Review is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants