Skip to content

Commit

Permalink
[blockchain] set default config values for blob storage
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinxie committed Oct 2, 2024
1 parent 4eeaaa8 commit d089f42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions blockchain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ var (
StakingIndexDBPath: "/var/data/staking.index.db",
SGDIndexDBPath: "/var/data/sgd.index.db",
ContractStakingIndexDBPath: "/var/data/contractstaking.index.db",
BlobStoreDBPath: "/var/data/blob.db",
BlobStoreRetentionDays: 20,
BlobPurgeInterval: time.Hour,
ID: 1,
EVMNetworkID: 4689,
Address: "",
Expand Down
9 changes: 9 additions & 0 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"path/filepath"
"strings"
"testing"
"time"

"github.com/iotexproject/go-pkgs/crypto"
"github.com/pkg/errors"
Expand Down Expand Up @@ -309,6 +310,14 @@ func TestValidateActPool(t *testing.T) {
)
}

func TestBlobConfig(t *testing.T) {
r := require.New(t)
cfg := Default
blocks := uint32(time.Hour / cfg.DardanellesUpgrade.BlockInterval)
blocks *= cfg.Chain.BlobStoreRetentionDays * 24
r.EqualValues(345600, blocks)
}

func TestValidateForkHeights(t *testing.T) {
r := require.New(t)

Expand Down

0 comments on commit d089f42

Please sign in to comment.