Skip to content

feat: Detach chunk identity from chunk name#56

Merged
define-null merged 5 commits into
masterfrom
defnull/NET-385/detach-chunk-identity-from-chunk-name
May 18, 2026
Merged

feat: Detach chunk identity from chunk name#56
define-null merged 5 commits into
masterfrom
defnull/NET-385/detach-chunk-identity-from-chunk-name

Conversation

@define-null

@define-null define-null commented May 13, 2026

Copy link
Copy Markdown
Contributor

Implements: https://linear.app/sqd-ai/issue/NET-385/detach-chunk-identity-from-chunk-name-in-sqd-network

What is this PR about?

PR changes the way worker is treating chunks. The logic which deduce block boundaries from the chunk id is mostly removed, and only kept in the layout for now. The idea is to allow chunk replacement, where a single chunk could be shadowed by another chunk of the same shape.

Read path for the worker has been modified to drop the branch which returned the last_block in certain cases. The chunk id shouldn't be used as a source of truth for the data that it corresponds to.

How does it work?

Chunk id is no longer analyzed in the read path and works purely as an id to lookup if the worker has corresponding chunk or not. The sqd-network was updated to support lookup based on the chunk ref.

According to @kalabukdima block range is always provided in the current implementation, so it's safe to expect the range.

@define-null define-null requested a review from kalabukdima May 13, 2026 13:08
Comment thread src/controller/p2p.rs Outdated
Comment thread Cargo.toml Outdated
Comment thread src/storage/tests.rs
In order to be able to detouch chunk ids from the data they reference the worker code should not parse
the chunk id format to obtain the last_block. It may not match with the actual data in the chunk, and that
prohibits chunk-id format changes.
ChunkRef.chunk becomes an opaque Arc<String>; DataChunk is reduced to
a layout parser. The on-disk format gains an optional trailing suffix
so multiple chunks can cover the same block range.
@define-null define-null force-pushed the defnull/NET-385/detach-chunk-identity-from-chunk-name branch from 85f2b0e to 2f95e5b Compare May 18, 2026 09:08
@define-null define-null requested a review from kalabukdima May 18, 2026 09:09
Comment thread src/types/state.rs Outdated
Comment thread src/storage/layout.rs Outdated
@define-null define-null requested a review from kalabukdima May 18, 2026 09:33
@define-null define-null merged commit 5ab36d9 into master May 18, 2026
3 checks passed
@define-null define-null deleted the defnull/NET-385/detach-chunk-identity-from-chunk-name branch May 18, 2026 09:36
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