diff --git a/CHANGELOG.md b/CHANGELOG.md index 45560da..8d13703 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +0.8.4: + - use end epoch without reduction when creating partitioned tables + 0.8.3: - add validator retention by pubkey - move to periodic finalization rather than event-triggered diff --git a/services/chaindb/postgresql/partitioning.go b/services/chaindb/postgresql/partitioning.go index fb31d2e..884690f 100644 --- a/services/chaindb/postgresql/partitioning.go +++ b/services/chaindb/postgresql/partitioning.go @@ -79,11 +79,9 @@ func (s *Service) createTablePartitions(ctx context.Context, startEpoch := chainTime.TimestampToEpoch(start) end := start.AddDate(0, 0, 1) + // endEpoch is exclusive, which means that endEpoch for today will equal startEpoch tomorrow. + // As such, no reduction in endEpoch is required. endEpoch := chainTime.TimestampToEpoch(end) - endEpochStart := chainTime.StartOfEpoch(endEpoch) - if endEpochStart.Before(end) { - endEpoch-- - } ctx, cancel, err := s.BeginTx(ctx) if err != nil {