Skip to content

fix(dev): prune blockstore on devnet nodes 3 and 4 - #426

Merged
rickyrombo merged 1 commit into
mainfrom
fix/devnet-node-pruning
Aug 5, 2026
Merged

fix(dev): prune blockstore on devnet nodes 3 and 4#426
rickyrombo merged 1 commit into
mainfrom
fix/devnet-node-pruning

Conversation

@rickyrombo

Copy link
Copy Markdown
Contributor

Problem

Devnet nodes 3 and 4 never set OPENAUDIO_RETAIN_HEIGHT, so they inherited the 604800-block default and retained every devnet block while non-archive compaction ran every block. Each grew to 47GB in ./tmp on the host disk — 94GB between them, which is what filled my boot volume.

tmp/oap3-data/core/openaudio-devnet/data/blockstore.db   23G
tmp/oap3-data/core/openaudio-devnet/data/state.db        22G
tmp/oap3-data/postgres                                  657M

Why this is a config gap, not tuning

The sizes are inverted:

node config size
1 ARCHIVE=true — never prunes at all 4.2 GB
2 non-archive, RETAIN_HEIGHT=10 2.7 GB
3, 4 non-archive, no retain height 47 GB each

The node that keeps every block forever is the small one, so the 43GB excess isn't unpruned blocks — it's Pebble retaining everything because calculateLowestRetainHeight never advances the retain height (data_companion.go). This change matches node 2.

Note

OPENAUDIO_PRUNING_ENABLED, OPENAUDIO_PRUNING_AMOUNT and OPENAUDIO_PRUNING_EARLIEST_HEIGHT — which node 2 also sets — are read by no Go code. They're deliberately not copied here; only OPENAUDIO_RETAIN_HEIGHT has any effect. Worth removing from node 2 separately.

make down already does rm -rf tmp/oap*, so existing oversized data is reclaimed on the next teardown.

🤖 Generated with Claude Code

Nodes 3 and 4 never set OPENAUDIO_RETAIN_HEIGHT, so they inherited the
604800-block default and retained every devnet block while non-archive
compaction ran every block. Each grew to 47GB (23GB blockstore.db + 22GB
state.db) in ./tmp on the host disk — 94GB between them.

The sizes were inverted, which is what makes this a config gap rather than
tuning: node 1 runs with OPENAUDIO_ARCHIVE=true and never prunes at all, yet
sits at 4.2GB, while node 2 — same non-archive settings as 3 and 4 but with
RETAIN_HEIGHT=10 — sits at 2.7GB. Match node 2.

Note that OPENAUDIO_PRUNING_ENABLED, OPENAUDIO_PRUNING_AMOUNT and
OPENAUDIO_PRUNING_EARLIEST_HEIGHT, which node 2 also sets, are read by no Go
code; they are not copied here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rickyrombo
rickyrombo merged commit fc6c83f into main Aug 5, 2026
5 checks passed
@rickyrombo
rickyrombo deleted the fix/devnet-node-pruning branch August 5, 2026 03:07
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.

1 participant