Skip to content

Bump OpenDHT minimum version and add DHT cache mechanism - #32

Open
jaja360 wants to merge 2 commits into
sim590:masterfrom
jaja360:caching
Open

Bump OpenDHT minimum version and add DHT cache mechanism#32
jaja360 wants to merge 2 commits into
sim590:masterfrom
jaja360:caching

Conversation

@jaja360

@jaja360 jaja360 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces disk caching for the DHT identity and node state in dpaste, significantly improving startup performance by enabling warm starts instead of cold-bootstrapping the DHT on every run. It also updates the required OpenDHT version from 1.2.0 to 3.0.0 across build scripts and documentation.

Caching improvements:

  • Added persistent caching of the DHT identity and node state in the user's cache directory (defaulting to ${XDG_CACHE_HOME}/dpaste), with support for overriding the location via the DPASTE_CACHE_DIR environment variable. The cache is loaded on startup and refreshed on shutdown, resulting in much faster subsequent startups. (src/node.cpp, src/node.h) [1] [2] [3]
  • Implemented logic to safely generate, cache, and load the DHT identity, handling concurrent runs and corrupt cache files gracefully. (src/node.cpp, src/node.h) [1] [2]

Documentation updates:

  • Added a new "Caching" section to the README.md to explain the new caching behavior and environment variable.

Dependency updates:

  • Updated the required OpenDHT version to 3.0.0 in CMakeLists.txt, configure.ac, and README.md to reflect compatibility with the new caching features and API. [1] [2] [3]

version 3.0 introduced the persistance API, which we need.
@sim590
sim590 self-requested a review September 3, 2026 04:59
@sim590 sim590 linked an issue Sep 3, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make use of OpenDHT's node local cache to speedup connections

2 participants