Skip to content

feat(config): default max_blob_size_mb to cache_size_mb, keep the knob (#1685) - #1686

Merged
alpergundogdu merged 2 commits into
mainfrom
claude/pr-1683-blob-size-default-cdfee7
Aug 14, 2026
Merged

alpergundogdu merged 2 commits into
mainfrom
claude/pr-1683-blob-size-default-cdfee7

Conversation

@alpergundogdu

@alpergundogdu alpergundogdu commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1685.

What changed

cache.max_blob_size_mb kept a fixed 1 GiB default (DEFAULT_MAX_BLOB_SIZE_MB) —
a memory-era number from when the warm/buyer leg buffered a whole blob in RAM.
On defaults it refused a blob a node's disk could easily hold.

Unset, max_blob_size_mb now resolves to cache_size_mb: the disk budget is
the admission ceiling, and a node admits any blob it can store. Nothing else
moves — the knob stays node-configurable (CLI --max-blob-size-mb, env
DECDN_MAX_BLOB_SIZE_MB, [cache] file), every serve/buyer gate stays, and the
wire meaning of BlobTooLarge is untouched.

The one forced consequence: the load-time invariant relaxes from
max_blob_size_mb < cache_size_mb to <=, so the default (equality) is legal.
A value above cache_size_mb is still rejected — a blob larger than the
whole cache can never be admitted — and 0 still means unlimited (it passes
0 <= cache_size_mb).

This is the small alternative to removing the knob (#1678, PR #1683 — both
closed). No gate removal, no wire-semantics rework, no 0-sentinel churn.

Known interaction (tracked, not fixed here)

node_origin::resume::pull_blob still buffers the whole blob into
LoopState.buf: Vec<u8>, bounded by max_blob_size_bytes. Raising the default
ceiling to cache_size_mb raises that one tier's worst-case RAM to the disk
budget until the buffer is ported to streaming — that port is #1682, which
stays open and is the real fix.

Also in this PR: runbook correction

The "Disk full" section of docs/runbook.md claimed no cache-capacity metric is
exported and that raising cache.cache_size_mb is a no-op. Both are stale since
the #1173 eviction driver — cache_size_mb is enforced (LRU release +
iroh-blobs GC reclaim), and decdn_cache_bytes / decdn_cache_size_limit_bytes
gauges track footprint against the ceiling. This PR makes cache_size_mb the
admission default too, so the correction lands alongside it.

Diff

  • crates/common/src/config/mod.rs — drop DEFAULT_MAX_BLOB_SIZE_MB; unset ⇒
    cache_size_mb; invariant < → <=; doc + tests.
  • crates/cli/src/commands/config.rs — template comment.
  • docs/runbook.md — correct the stale cache_size_mb-unenforced claims.
  • CHANGELOG.md — config entry.

Verification

  • cargo nextest run -p decdn-common -p decdn-cli — 853 passed, 0 failed
  • cargo clippy -p decdn-common -p decdn-cli --all-targets — clean
  • cargo fmt -- --check — clean
  • pre-commit (clippy/fmt/doc/deny/markdownlint) — all passed

🤖 Generated with Claude Code

#1685)

The 1 GiB `DEFAULT_MAX_BLOB_SIZE_MB` was a memory-era number from when the
warm/buyer leg buffered a whole blob in RAM. On defaults it refused a blob a
node's disk could easily hold.

Unset, `cache.max_blob_size_mb` now resolves to `cache_size_mb` — the disk
budget is the admission ceiling and a node admits any blob it can store. The
knob stays node-configurable for operators who want a tighter per-blob bound.
The load-time invariant relaxes from `< cache_size_mb` to `<=` so the default
(equality) is legal; a value above `cache_size_mb` is still rejected and `0`
still means unlimited.

Every serve/buyer gate and the wire meaning of `BlobTooLarge` are unchanged.
This is the smaller alternative to removing the knob (#1678); the buffered
miss tier's RAM buffer is ported separately in #1682.

Co-Authored-By: Claude Opus 4.8 <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the deCDN node cache configuration so that cache.max_blob_size_mb no longer defaults to a fixed 1 GiB. Instead, when unset it resolves to cache.cache_size_mb, making the cache’s disk budget the default per-blob admission ceiling while keeping the operator-configurable knob intact.

Changes:

  • Remove the fixed DEFAULT_MAX_BLOB_SIZE_MB default and resolve unset max_blob_size_mb to cache_size_mb.
  • Relax config-load validation from max_blob_size_mb < cache_size_mb to <= (equality becomes valid/default).
  • Update the CLI config template comment and add a CHANGELOG entry; adjust/extend tests accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
crates/common/src/config/mod.rs Drops the fixed max-blob default, defaults unset to cache_size_mb, relaxes invariant to <=, updates error text and tests.
crates/cli/src/commands/config.rs Updates the generated config template comment to reflect the new default/invariant.
CHANGELOG.md Documents the new default behavior and the invariant change.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 14, 2026 •

Copy link
Copy Markdown

Coverage report

Total: 80.79% (was 80.79%, ● 0.00%) — 59399/73521 lines

File Coverage Lines Δ
crates/cli/src/commands/config.rs 85.71% 534/623 ● 0.00%
crates/common/src/config/mod.rs 97.11% 6857/7061 ▲ +0.01%
History
Commit Total Δ vs base
1e720cc 80.79% ● 0.00%
d3adcf5 (HEAD) 80.79% ● 0.00%

The Disk full section claimed no cache-capacity metric is exported and that
raising cache.cache_size_mb is a no-op. Both are wrong since the #1173
eviction driver: cache_size_mb is enforced (LRU release + iroh-blobs GC
reclaim), and decdn_cache_bytes / decdn_cache_size_limit_bytes gauges track
footprint against the ceiling. This PR makes cache_size_mb the admission
default too, so the correction is worth landing alongside it.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@alpergundogdu
alpergundogdu merged commit 268f9d2 into main Aug 14, 2026
3 checks passed
@alpergundogdu
alpergundogdu deleted the claude/pr-1683-blob-size-default-cdfee7 branch August 17, 2026 17:47
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.

feat(config): default max_blob_size_mb to cache_size_mb, keep the knob

2 participants