Design and implement Rust logic for peer nodes to temporarily retain (pin/cache) encrypted records for other nodes during downtime. This logic should:
- Detect when a peer node goes offline, identify its records for retention.
- Pin/copy relevant records to local storage (using the fetch/pin interfaces).
- Track retention windows and unpin after expiry or when owner returns.
- Accept and verify signed requests for early deletion from owner nodes.
- Provide status info on which peer is retaining which records.
Implementation Suggestions:
- Build a
RetentionManager struct/module.
- Integrate with async liveness monitoring (e.g., using
tokio).
- Use event-driven approach: on peer-down, trigger retention; on peer-up, cleanup.
- Ensure all actions are signed and auditable.
- Add integration tests for peer-down/up and data lifecycle.
Design and implement Rust logic for peer nodes to temporarily retain (pin/cache) encrypted records for other nodes during downtime. This logic should:
Implementation Suggestions:
RetentionManagerstruct/module.tokio).