[PR #270] [MERGED] fix(p2p): avoid duplicate storage of fetched image layers #306

Closed
opened 2026-10-29 14:22:01 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/270
Author: @LSX-s-Software
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/10/2026
Merged by: @yingdi-shan

Base: main ← Head: perf/p2p


📝 Commits (2)

  • 1118782 fix(p2p): avoid duplicate storage of fetched image layers
  • 953f56b fix(p2p): fix race condition between download and export

📊 Changes

6 files changed (+287 additions, -53 deletions)

View changed files

📝 src/image/cache/service.rs (+15 -13)
📝 src/p2p/iroh/transport.rs (+209 -29)
📝 src/p2p/mock.rs (+9 -4)
📝 src/p2p/mod.rs (+1 -1)
📝 src/p2p/transport.rs (+40 -6)
📝 src/p2p/types.rs (+13 -0)

📄 Description

What

Skip automatic P2P advertisement when fetching converted image layers. After validation, publish the persisted image-cache file through the existing Reference path so the fetched blob is not retained as a second advertised artifact.

Why

The current code stores two copies of the converted image layer: one in P2P's internal blob store and the other in the image cache. This duplication of storage takes up twice as much space.

Scope and non-goals

Scope:

  • Image cache and p2p.

Non-Goals:

  • Make p2p fetch zero-copy.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • make -C services test (required when services/ changes)
  • Generated clients/server regenerated with the documented make target
  • Documentation updated
  • Benchmarks or performance comparison completed

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/270 **Author:** [@LSX-s-Software](https://github.com/LSX-s-Software) **Created:** 9/9/2026 **Status:** ✅ Merged **Merged:** 9/10/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `perf/p2p` --- ### 📝 Commits (2) - [`1118782`](https://github.com/kvcache-ai/AgentENV/commit/1118782aa0ab69250190d2105730214417d8557f) fix(p2p): avoid duplicate storage of fetched image layers - [`953f56b`](https://github.com/kvcache-ai/AgentENV/commit/953f56ba827fbedb0ea8827201b87bf203a279bc) fix(p2p): fix race condition between download and export ### 📊 Changes **6 files changed** (+287 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `src/image/cache/service.rs` (+15 -13) 📝 `src/p2p/iroh/transport.rs` (+209 -29) 📝 `src/p2p/mock.rs` (+9 -4) 📝 `src/p2p/mod.rs` (+1 -1) 📝 `src/p2p/transport.rs` (+40 -6) 📝 `src/p2p/types.rs` (+13 -0) </details> ### 📄 Description ## What Skip automatic P2P advertisement when fetching converted image layers. After validation, publish the persisted image-cache file through the existing `Reference` path so the fetched blob is not retained as a second advertised artifact. ## Why The current code stores two copies of the converted image layer: one in P2P's internal blob store and the other in the image cache. This duplication of storage takes up twice as much space. ## Scope and non-goals Scope: - Image cache and p2p. Non-Goals: - Make p2p fetch zero-copy. ## Validation - [x] `make fmt` - [x] `make clippy` - [x] `make test-unit` - [x] Relevant Rust integration tests - [ ] `make -C services test` (required when `services/` changes) - [ ] Generated clients/server regenerated with the documented `make` target - [ ] Documentation updated - [ ] Benchmarks or performance comparison completed ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:22:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#306
No description provided.