diff --git a/cmd/soroban-rpc/internal/config/options.go b/cmd/soroban-rpc/internal/config/options.go index cd1e425d..d2ed8c80 100644 --- a/cmd/soroban-rpc/internal/config/options.go +++ b/cmd/soroban-rpc/internal/config/options.go @@ -212,10 +212,8 @@ func (cfg *Config) options() ConfigOptions { { Name: "history-retention-window", Usage: fmt.Sprintf("configures the history retention window expressed in number of ledgers,"+ - " the default value is %d which corresponds to about 7 days of history", ledgerbucketwindow.SevenDaysOfLedgers), - ConfigKey: &cfg.HistoryRetentionWindow, - DefaultValue: uint32(ledgerbucketwindow.SevenDaysOfLedgers), - Validate: positive, + " the maximum value can be %d which corresponds to about 7 days of history", ledgerbucketwindow.SevenDaysOfLedgers), + ConfigKey: &cfg.HistoryRetentionWindow, }, { diff --git a/cmd/soroban-rpc/internal/ledgerbucketwindow/ledgerbucketwindow.go b/cmd/soroban-rpc/internal/ledgerbucketwindow/ledgerbucketwindow.go index ec185a2f..f58579fe 100644 --- a/cmd/soroban-rpc/internal/ledgerbucketwindow/ledgerbucketwindow.go +++ b/cmd/soroban-rpc/internal/ledgerbucketwindow/ledgerbucketwindow.go @@ -22,7 +22,7 @@ type LedgerBucket[T any] struct { // OneDayOfLedgers is (roughly) a 24 hour window of ledgers. const OneDayOfLedgers = 17280 -const SevenDaysOfLedgers = 120960 +const SevenDaysOfLedgers = 7 * OneDayOfLedgers // DefaultEventLedgerRetentionWindow represents the max number of ledgers we // would like to keep an incoming event in memory. diff --git a/cmd/soroban-rpc/internal/test/health_test.go b/cmd/soroban-rpc/internal/test/health_test.go index 11d264f4..0840959c 100644 --- a/cmd/soroban-rpc/internal/test/health_test.go +++ b/cmd/soroban-rpc/internal/test/health_test.go @@ -23,7 +23,7 @@ func TestHealth(t *testing.T) { t.Fatalf("rpc call failed: %v", err) } assert.Equal(t, "healthy", result.Status) - assert.Equal(t, uint32(ledgerbucketwindow.SevenDaysOfLedgers), result.LedgerRetentionWindow) + assert.Equal(t, uint32(ledgerbucketwindow.OneDayOfLedgers), result.LedgerRetentionWindow) assert.Greater(t, result.OldestLedger, uint32(0)) assert.Greater(t, result.LatestLedger, uint32(0)) assert.GreaterOrEqual(t, result.LatestLedger, result.OldestLedger)