Nibiru runtime already defaults to PebbleDB; Heart Monitor reads chain data through the Pebble Go API. This issue finishes removing leftover RocksDB and grocksdb build and module baggage from the monorepo—the migration started in #1818, #1908, and #1979.
Root file go.mod and file lib/sai-trading/go.mod carry a tracked TODO pointing here. The work is build and dependency cleanup, not a runtime backend switch.
Runtime and indexer are already on Pebble
| Component |
Today |
| Node default |
constant DefaultDBBackend = db.PebbleDBBackend in file app/appconst/appconst.go |
| Binary default |
ldflag -X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledb in build script contrib/scripts/build-nibiru.sh |
| Tests |
build tag pebbledb in file contrib/make/test.mk and recipe justfile test paths |
| Heart Monitor |
function pebble.Open read-only on {CHAIN_DB_PATH}/blockstore.db and state.db (nibi-go-hm/services/chaindb.go); Rocks branches panic |
Heart Monitor does not parse Pebble SST internals. It uses the Pebble client Get with CometBFT application keys (H:{height}, P:{height}:{index}, abciResponsesKey:{height}) and protobuf-decodes values—see files nibi-go-hm/services/blocks_tracker.go and nibi-go-hm/services/events_tracker/events_processor.go.
Why Pebble over Rocks for Nibiru
- Same on-disk layout the node writes when config key
db_backend=pebbledb — Heart Monitor is aligned.
- Simpler builds: drop target
ensure_rocksdb_lib in script contrib/scripts/build-nibiru.sh (wget librocksdb.a v8.9.1), CGO -lrocksdb, and Linux dev packages (lz4, snappy, bz2, zstd, …) from the build path.
- Cosmos direction: Pebble is the maintained path; Rocks is legacy ballast in the Makefile/module graph.
- Operational note: Rocks via module
grocksdb is CGo + C++; known upstream leak/OOM reports exist (rocksdb#4313, rocksdb#13645). Pebble is not leak-free either (pebble#1588) but matches the default backend and avoids shipping unused Rocks linkage in every nibid build.
What still drags Rocks in today
- Function
build_tags_for_os in script contrib/scripts/build-nibiru.sh includes build tags rocksdb and pebbledb; the build path calls function ensure_rocksdb_lib before compile.
- Command
go mod why → module cometbft/cometbft-db → module linxGnu/grocksdb (unconditional module require, even when only Pebble is used).
- Replace pin for module
grocksdb in root file go.mod, file lib/sai-trading/go.mod, and test contrib/go_mod_replace_test.go.
Safety preconditions
Implementation checklist
nibi-chain — build
nibi-chain — modules
nibi-chain — docs / comments
nibi-go-hm (heart-monitor) — follow-up (same PR or follow-on)
Verification
References
- CHANGELOG: #1818 Pebble support, #1908 Pebble default, #1979 integration tests
- Geth upgrade note (Pebble dep): CHANGELOG v1.14 / module
cockroach/pebble
- Heart Monitor Pebble fork: replace
github.com/NibiruChain/pebble in file nibi-go-hm/go.mod
Nibiru runtime already defaults to PebbleDB; Heart Monitor reads chain data through the Pebble Go API. This issue finishes removing leftover RocksDB and
grocksdbbuild and module baggage from the monorepo—the migration started in #1818, #1908, and #1979.Root file
go.modand filelib/sai-trading/go.modcarry a tracked TODO pointing here. The work is build and dependency cleanup, not a runtime backend switch.Runtime and indexer are already on Pebble
DefaultDBBackend = db.PebbleDBBackendin fileapp/appconst/appconst.go-X github.com/cosmos/cosmos-sdk/types.DBBackend=pebbledbin build scriptcontrib/scripts/build-nibiru.shpebbledbin filecontrib/make/test.mkand recipejustfiletest pathspebble.Openread-only on{CHAIN_DB_PATH}/blockstore.dbandstate.db(nibi-go-hm/services/chaindb.go); Rocks branches panicHeart Monitor does not parse Pebble SST internals. It uses the Pebble client
Getwith CometBFT application keys (H:{height},P:{height}:{index},abciResponsesKey:{height}) and protobuf-decodes values—see filesnibi-go-hm/services/blocks_tracker.goandnibi-go-hm/services/events_tracker/events_processor.go.Why Pebble over Rocks for Nibiru
db_backend=pebbledb— Heart Monitor is aligned.ensure_rocksdb_libin scriptcontrib/scripts/build-nibiru.sh(wgetlibrocksdb.av8.9.1), CGO-lrocksdb, and Linux dev packages (lz4,snappy,bz2,zstd, …) from the build path.grocksdbis CGo + C++; known upstream leak/OOM reports exist (rocksdb#4313, rocksdb#13645). Pebble is not leak-free either (pebble#1588) but matches the default backend and avoids shipping unused Rocks linkage in everynibidbuild.What still drags Rocks in today
build_tags_for_osin scriptcontrib/scripts/build-nibiru.shincludes build tagsrocksdbandpebbledb; the build path calls functionensure_rocksdb_libbefore compile.go mod why→ modulecometbft/cometbft-db→ modulelinxGnu/grocksdb(unconditional modulerequire, even when only Pebble is used).grocksdbin root filego.mod, filelib/sai-trading/go.mod, and testcontrib/go_mod_replace_test.go.Safety preconditions
grocksdbfor chain reads.-tags=pebbledbonly.db_backend=rocksdb? Confirm with ops before merge. If any remain, document migration (re-sync or explicit backend change) in PR/release notes—not a blocker for build cleanup if all managed nodes are on Pebble.Implementation checklist
nibi-chain— buildrocksdbfrom functionbuild_tags_for_osin scriptcontrib/scripts/build-nibiru.shensure_rocksdb_liband Rocks CGO flags (CGO_CFLAGS/CGO_LDFLAGS, Darwin-lrocksdb)Dockerfilemake build/just buildstill succeeds without Rocks artifactsnibi-chain— modulesgithub.com/linxGnu/grocksdbreplace and indirect dep from root filego.mod(and filelib/sai-trading/go.modif still synced)contrib/go_mod_replace_test.go— dropgrocksdbfrom required replacescometbft-dbstill pullinggrocksdb(bump/forkcometbft-dbif needed so module graph is clean without Rocks build tag)go mod tidyand fix any transitive fallout under directorieslib/cosmos-sdk//lib/wasmvm/if requirednibi-chain— docs / commentsgosdk/README.md, comment in fileapp/upgrades/v1.go, fileLEGACY-CHANGELOG.md(optional)nibi-go-hm(heart-monitor) — follow-up (same PR or follow-on)else { // Rocksdb }panic branches in fileservices/chaindb.gogo test -tags rocksdbwith Pebble-only instructionsgrocksdbfrom filego.modonce thenibirudependency graph no longer pulls itVerification
just buildon Linux (and Darwin if applicable)just test-fast/ test recipes with build tag-tags=pebbledbCHAIN_DB_PATHstill works against Pebbleblockstore.db/state.dbReferences
cockroach/pebblegithub.com/NibiruChain/pebblein filenibi-go-hm/go.mod