-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(x/epochs): avoid invalid epoch duration in simulation #20030
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -14,7 +14,7 @@ import ( | |||||
|
||||||
// GenCommunityTax randomized CommunityTax | ||||||
func GenDuration(r *rand.Rand) time.Duration { | ||||||
return time.Hour * time.Duration(r.Intn(168)) // limit 1 week | ||||||
return time.Hour * time.Duration(r.Intn(167)+1) // between 1 hour to 1 week | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure the upper bound of the random duration is correctly set. The current implementation ( - return time.Hour * time.Duration(r.Intn(167)+1) // between 1 hour to 1 week
+ return time.Hour * time.Duration(r.Intn(168)+1) // between 1 hour to 1 week Committable suggestion
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we follow the original logic which is 167 hours There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mmsqe, the suggestion to adjust the upper bound to 168 hours was aimed at ensuring the duration could fully cover up to a complete week (168 hours). This adjustment was intended to enhance the accuracy of the simulation's time span. However, if there's a specific reason or context within the simulation framework that makes 167 hours more appropriate, or if aligning exactly to a week introduces any issues, it would be helpful to understand that context. Could you please share if there's a particular reason for preferring the original logic of 167 hours? This will help in making the most informed decision. |
||||||
} | ||||||
|
||||||
func RandomizedEpochs(r *rand.Rand) []types.EpochInfo { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need a changelog for this.