@@ -8,48 +8,14 @@ import (
88 ds "github.com/ipfs/go-datastore"
99 ktds "github.com/ipfs/go-datastore/keytransform"
1010 dsq "github.com/ipfs/go-datastore/query"
11- dssync "github.com/ipfs/go-datastore/sync"
1211 badger4 "github.com/ipfs/go-ds-badger4"
1312)
1413
1514// EvPrefix is used in KV store to separate ev-node data from execution environment data (if the same data base is reused)
1615const EvPrefix = "0"
1716
1817// NewDefaultKVStore creates instance of default key-value store.
19- //
20- // HACK(fiber-throughput): swapped to a pure in-memory map for the
21- // Fibre throughput investigation. The real issue this surfaces is
22- // architectural, not a Badger bug: block.executing.Executor.ProduceBlock
23- // calls store.batch.Commit() synchronously inside the producer, so
24- // the storage engine's write rate is a hard ceiling on block
25- // production. With 128 MiB blocks × ~1 b/s the on-disk path drives
26- // ~150 MB/s of value-log writes plus heavy compaction; the producer
27- // blocks on Badger long before the DA submitter is the bottleneck.
28- //
29- // Don't revert this in place — fix the underlying design instead.
30- // Options worth weighing:
31- // - Move the block save off the producer hot path (async commit
32- // with a bounded queue). Block durability is not required to
33- // advance state, only to recover after restart.
34- // - For Fibre-only rollups specifically: skip local persistence
35- // entirely. Fibre IS the storage; a node can re-sync from the
36- // chain on restart. This removes the question.
37- // - If we keep persisting, pick a write-optimised backend that
38- // handles 100s of MB/s of large-value writes without compaction
39- // stalls. Badger v4 with these tunings still hit a .vlog
40- // rotation race under sustained load.
41- //
42- // NewDefaultKVStoreOnDisk preserved below as the literal Badger
43- // constructor for any caller that explicitly wants disk-backed
44- // state today; the production wiring should switch to one of the
45- // three options above before this directory is dropped.
46- func NewDefaultKVStore (_ , _ , _ string ) (ds.Batching , error ) {
47- return dssync .MutexWrap (ds .NewMapDatastore ()), nil
48- }
49-
50- // NewDefaultKVStoreOnDisk is the original Badger-backed constructor,
51- // preserved for the duration of the throughput-cleanup window.
52- func NewDefaultKVStoreOnDisk (rootDir , dbPath , dbName string ) (ds.Batching , error ) {
18+ func NewDefaultKVStore (rootDir , dbPath , dbName string ) (ds.Batching , error ) {
5319 path := filepath .Join (rootify (rootDir , dbPath ), dbName )
5420 return badger4 .NewDatastore (path , BadgerOptions ())
5521}
0 commit comments