Skip to content

feat: add DHT provider and value maintenance - #346

Merged
adust09 merged 1 commit into
developfrom
feat/292-dht-republish-20261029-0147
Oct 30, 2026
Merged

adust09 merged 1 commit into
developfrom
feat/292-dht-republish-20261029-0147

Conversation

@adust09

@adust09 adust09 commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary

Add configurable DHT maintenance with go-libp2p-compatible defaults: locally provided keys are republished every 22 hours, value records expire after 48 hours, and bounded value GC runs every 24 hours. Provider and GC workers stop through stopDHTNode, and the public facade exposes configuration plus an injectable clock for deterministic tests.

Value records are deliberately not auto-republished: as in go-libp2p core, the DHT cannot infer application ownership of arbitrary value keys, so applications must republish owned values before dmcRecordMaxAge.

Spec reference

Testing

  • cabal test all --test-show-details=direct — 1477 examples, 0 failures
  • Added deterministic tests for provider reannouncement, bounded batch rotation, lazy/background value expiry, GET_VALUE filtering, and worker shutdown

Closes #292

Republish locally provided keys before provider records expire and add configurable, bounded value-record expiry and garbage collection. Ensure maintenance workers share DHT shutdown and cover expiry and cancellation behavior with deterministic tests.
@github-actions github-actions Bot added the enhancement New feature or request label Oct 29, 2026
@adust09
adust09 merged commit 7ba9b9c into develop Oct 30, 2026
5 checks passed
@adust09
adust09 deleted the feat/292-dht-republish-20261029-0147 branch October 30, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dht: provider/value republish and value-record expiry

1 participant