Repository navigation
refactor: one cache store, with the pull-side store contract in bao-range - #2907
Closed
alpergundogdu wants to merge 1 commit into
Closed
alpergundogdu wants to merge 1 commit into
alpergundogdu wants to merge 1 commit into
Conversation
…ange IngestStore, StreamStore, BaoRangeReader, StashedFault, IngestEnd, IngestFuture, SourceFuture, HashMismatch and ProvenSize move from decdn-client to decdn-bao-range, beside RangedStore. decdn-client re-exports each at its old path. decdn_cache::CacheStore implements the contract once and replaces the node's NodeAdmitStore and the gateway's own store; the gateway keeps only its StreamStores opener. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Combined into #2908, which carries this PR's commits together with the rest of the stack so they land as one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #2906, which is stacked on #2905; it rebases to
mainas they merge. One store overCacheEnginereplaces two copies: the node'sNodeAdmitStoreand the gateway'sCacheStore.They were written twice because neither crate could own them. Their trait lived in
decdn-client, anddecdn-cacheanddecdn-clientmust not depend on each other (#578). The contract now lives besideRangedStoreindecdn-bao-range, which both already depend on, sodecdn-cacheimplements it once.What changes
decdn-bao-range::ingestholds the pull-side store contract:IngestStore,StreamStore,BaoRangeReader,StashedFault,IngestEnd,IngestFuture,SourceFutureandHashMismatch.ProvenSizemoves tosize_proof.ProvenSize::verifyis its only constructor, so a size still comes only from a proof that verified.decdn-bao-rangegainsanyhow,iroh-ioandtokio. None of them is the blob store, and the client SDK already links all three.decdn-clientre-exports every moved name at its old path, so callers compile unchanged. Itstest-utilfeature turns ondecdn-bao-range/test-util, whereProvenSize::assume_for_testsand the in-memoryStashedFault for Bytesnow live. Thepublic_apisnapshot changes only in paths.decdn_cache::CacheStoreis the one store. It admits throughadmit_bao_stream_until(progress, early stop, a wake-up for the reader), with two optional parts:with_session: captures proof nodes for a serving leg, which the node uses;on_admitted: the node'sdecdn_bytes_received_totalcount.The node builds
CacheStorewhere it builtNodeAdmitStore. One behavior changes: a lowered end now stops a leg instead of failing as a local fault. The node's pull never lowers one.The gateway keeps only its
CacheStoresopener, which implementsStreamStoresfrom the client.Tests: the store's tests live in
decdn-cache:HashMismatch;The node keeps its two fault-verdict tests, now in
node_origin/store_fault_tests.rs. The CLI keeps theStreamerround-trip test.decdn getand the SDK keepClientRangedStore. Moving the client onto the cache is still blocked on client: re-evaluate running decdn-client on the iroh-blobs store (0.104.1) #2881's open items.Tests
cargo nextest runoverdecdn-bao-range,decdn-client,decdn-cache,decdn-node,decdn-cli,decdn-commonandsponsord-core.anvil-e2egateway journeys, plusnode_origin_pullandclient_loopback.cargo clippy --workspace --all-targets --all-featureswith warnings denied,-p decdn-cache --no-default-features,cargo doc,check_crate_edges.py,cargo fmt --check.public_apisnapshot regenerated.🤖 Generated with Claude Code