[PSE] Use incremental ID for ScheduledDistributions#91
[PSE] Use incremental ID for ScheduledDistributions#91metalarm10 wants to merge 14 commits intomasterfrom
Conversation
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 23 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on masihyeganeh, metalarm10, TxCorpi0x, and ysv).
x/pse/types/params.go line 146 at r1 (raw file):
"period %d: id must be sequential, expected %d but got %d", i, schedule[i-1].Id+1, period.Id) }
I guess we should also add the check to that the current timestamp is greater than the previous timestamp (i.e monotonically increasing).
I think there was already such a check somewhere, can you check where it was and if it makes sense to merge them ? let's discuss on call.
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on masihyeganeh, metalarm10, TxCorpi0x, and ysv).
proto/tx/pse/v1/distribution.proto line 61 at r1 (raw file):
// id is the unique, sequential identifier for this distribution. // Used as the storage key in the AllocationSchedule map. uint64 id = 3 [
you should add proto tags such that the golang structs are formed as ID not Id. There are examples in the code base.
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on masihyeganeh, metalarm10, TxCorpi0x, and ysv).
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 made 2 comments.
Reviewable status: 13 of 24 files reviewed, 2 unresolved discussions (waiting on masihyeganeh, miladz68, TxCorpi0x, and ysv).
proto/tx/pse/v1/distribution.proto line 61 at r1 (raw file):
Previously, miladz68 (milad) wrote…
you should add proto tags such that the golang structs are formed as
IDnotId. There are examples in the code base.
Done.
x/pse/types/params.go line 146 at r1 (raw file):
Previously, miladz68 (milad) wrote…
I guess we should also add the check to that the current timestamp is greater than the previous timestamp (i.e monotonically increasing).
I think there was already such a check somewhere, can you check where it was and if it makes sense to merge them ? let's discuss on call.
Done.
Description
This PR closes: https://app.clickup.com/t/868hj36t9
idfield toScheduledDistributionAllocationSchedulestorage key from timestamp toidmin_distribution_gap_secondsgovernance param (default: 1 day) — enforces a minimum time gap between consecutive distribution timestampsMsgUpdateMinDistributionGapgovernance message to update the gap param; validates the proposed gap against the existing on-chain scheduleValidateDistributionSchedule: IDs must be non-zero and strictly sequential (each = previous + 1)ValidateDistributionGapto enforce minimum time gap between every consecutive pair of distribution timestamps (called during both genesis validation and governance schedule updates)Reviewers checklist:
Authors checklist
This change is