Miftahul Arifin
All projects
At work

Sprune

A safe, automated pruner for Cosmos chain nodes.

RoleEngineer · Cakra Labs
Year2024
StatusOpen source
Built withGo · Cosmos SDK

Why I built it

Cosmos nodes keep every block and every state version until someone prunes them, and the usual advice to “prune your node” came with fragile, poorly documented tooling. Operators tended to put it off until the disk was full.

What it does

How it’s built

A Go command-line tool that works directly on the node’s LevelDB or RocksDB databases.

The hard part

Not corrupting state. You can’t delete arbitrary heights without breaking the chain of state roots, so the tool had to understand each database’s key layout well enough to know which keys are safe to remove and the minimum history a node needs to restart.

Stack

GoCosmos SDKCometBFTLevelDBRocksDB