Skip to content

Commit

Permalink
extended sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
piotr-iohk committed Mar 1, 2024
1 parent 6158c73 commit 2e13639
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/delegation_backend/aws_keyspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,12 @@ func (kc *KeyspaceContext) insertSubmission(submission *Submission) error {
}, maxRetries, initialBackoff)
}

// calculateShard returns the shard number for a given submission time.
// 0-599 are the possible shard numbers, each representing a 6-second interval.
func calculateShard(submittedAt time.Time) int {
// return minute of the hour
return submittedAt.Minute()
minute := submittedAt.Minute()
second := submittedAt.Second()
return minute*10 + second/6
}

func (kc *KeyspaceContext) tryInsertSubmission(submission *Submission, includeRawBlock bool) error {
Expand Down

0 comments on commit 2e13639

Please sign in to comment.