Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions config/config.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package config

const (
DefaultSnapshotInterval = 10000
DefaultSnapshotKeepRecent = 1
DefaultSnapshotWriterLimit = 1
DefaultAsyncCommitBuffer = 100
DefaultCacheSize = 100000
DefaultSSKeepRecent = 100000
DefaultSSPruneInterval = 600
DefaultSSImportWorkers = 1
DefaultSSAsyncBuffer = 100
DefaultSSHashRange = 1000000
DefaultSnapshotInterval = 10000
DefaultSnapshotKeepRecent = 1
DefaultSnapshotWriterLimit = 1
DefaultAsyncCommitBuffer = 100
DefaultCacheSize = 100000
DefaultSSKeepRecent = 100000
DefaultSSPruneInterval = 600
DefaultSSImportWorkers = 1
DefaultSSAsyncBuffer = 100
DefaultSSHashRange = 1000000
DefaultIncrementalSnapshotInterval = 1000
)

type StateCommitConfig struct {
Expand Down Expand Up @@ -41,6 +42,16 @@ type StateCommitConfig struct {
// SnapshotInterval defines the block interval the memiavl snapshot is taken, default to 10000.
SnapshotInterval uint32 `mapstructure:"snapshot-interval"`

// IncrementalSnapshotInterval defines the block interval for incremental snapshots between full snapshots.
// Incremental snapshots only contain modified nodes since the last snapshot, making them much faster to create.
// Defaults to 1000. Set to 0 to disable incremental snapshots.
IncrementalSnapshotInterval uint32 `mapstructure:"incremental-snapshot-interval"`

// IncrementalSnapshotTrees defines which trees should use incremental snapshots.
// If empty, all trees will use incremental snapshots when enabled.
// Example: ["bank", "acc"] to enable incremental snapshots only for bank and acc trees.
IncrementalSnapshotTrees []string `mapstructure:"incremental-snapshot-trees"`

// SnapshotWriterLimit defines the concurrency for taking commit store snapshot
SnapshotWriterLimit int `mapstructure:"snapshot-writer-limit"`

Expand Down Expand Up @@ -100,11 +111,13 @@ type StateStoreConfig struct {

func DefaultStateCommitConfig() StateCommitConfig {
return StateCommitConfig{
Enable: true,
AsyncCommitBuffer: DefaultAsyncCommitBuffer,
CacheSize: DefaultCacheSize,
SnapshotInterval: DefaultSnapshotInterval,
SnapshotKeepRecent: DefaultSnapshotKeepRecent,
Enable: true,
AsyncCommitBuffer: DefaultAsyncCommitBuffer,
CacheSize: DefaultCacheSize,
SnapshotInterval: DefaultSnapshotInterval,
SnapshotKeepRecent: DefaultSnapshotKeepRecent,
IncrementalSnapshotInterval: DefaultIncrementalSnapshotInterval,
IncrementalSnapshotTrees: []string{}, // Empty means all trees
}
}

Expand Down
Loading
Loading