Skip to content

Commit

Permalink
chore: review feedback improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Jun 24, 2024
1 parent 20ac109 commit cb76263
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion x/shared/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,19 @@ func GetEarliestClaimCommitHeight(
// window open block hash and the supplier address.
randomNumber := poktrand.SeededInt63(claimWindowOpenBlockHash, []byte(supplierAddr))

distributionWindowSizeBlocks := sharedParams.ClaimWindowCloseOffsetBlocks - sharedParams.ClaimWindowOpenOffsetBlocks
distributionWindowSizeBlocks := GetClaimWindowSizeBlocks(sharedParams)
randCreateClaimHeightOffset := randomNumber % int64(distributionWindowSizeBlocks)

return claimWindowOpenHeight + randCreateClaimHeightOffset
}

// GetClaimWindowSizeBlocks returns the number of blocks between the opening and closing
// of the claim window, given the passed sharedParams.
func GetClaimWindowSizeBlocks(sharedParams *sharedtypes.Params) uint64 {
return sharedParams.ClaimWindowCloseOffsetBlocks -
sharedParams.ClaimWindowOpenOffsetBlocks
}

// GetEarliestProofCommitHeight returns the earliest block height at which a proof
// for the session that includes queryHeight can be committed for a given supplier
// and the passed sharedParams.
Expand Down

0 comments on commit cb76263

Please sign in to comment.