Skip to content

feat(p2p-05): add fetched cache backend (#671) - #13

Open
jlon wants to merge 1 commit into
p2p-04-client-p2p-module-shellfrom
p2p-05-fetched-cache-backend
Open

feat(p2p-05): add fetched cache backend (#671)#13
jlon wants to merge 1 commit into
p2p-04-client-p2p-module-shellfrom
p2p-05-fetched-cache-backend

Conversation

@jlon

@jlon jlon commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add the fetched-cache backend needed for later P2P read reuse.
  • Keep the backend dormant until a later PR wires it into the read path.

Design

  • Separate normal file-backed cache entries from append-only fetched-log entries.
  • Track checksum, mtime, eviction, and corruption state so later read-path work has a stable backend contract.

Implementation

  • Add CacheManager with TTL, sharding, batch append, checksum validation, and snapshot accounting.
  • Export the backend from p2p and add the ring dependency for digest support.

Verification

  • cargo test -p curvine-client duplicate_put_refreshes_without_rewrite
  • cargo test -p curvine-client fetched_batch_put_writes_and_reads_back
  • cargo test -p curvine-client wrong_checksum_hint_is_detected_on_read

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@jlon
jlon force-pushed the p2p-04-client-p2p-module-shell branch from 032f2e6 to e389ef7 Compare March 26, 2026 10:26
@jlon
jlon force-pushed the p2p-05-fetched-cache-backend branch from 48a468e to 92f1043 Compare March 26, 2026 10:26
@jlon
jlon force-pushed the p2p-04-client-p2p-module-shell branch from e389ef7 to e8e08e2 Compare March 27, 2026 09:32
@jlon
jlon force-pushed the p2p-05-fetched-cache-backend branch from 92f1043 to 5fbbdfc Compare March 27, 2026 09:32
@jlon
jlon force-pushed the p2p-04-client-p2p-module-shell branch from e8e08e2 to 848bc0d Compare March 30, 2026 00:54
@jlon
jlon force-pushed the p2p-05-fetched-cache-backend branch from 5fbbdfc to 9a8bb64 Compare March 30, 2026 00:55
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.

1 participant