Skip to content

Commit

Permalink
Fix review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
psheth9 committed May 15, 2024
1 parent d08ab28 commit 201da81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions cmd/soroban-rpc/internal/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},

{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/soroban-rpc/internal/test/health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 201da81

Please sign in to comment.