PSE Proposals message hanlders#31
Conversation
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 19 of 19 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @masihyeganeh and @miladz68)
a discussion (no related file):
Would be nice to use proper names for proper processes
x/pse/keeper/distribution.go line 224 at r1 (raw file):
// Returns an empty slice if no allocations are scheduled. // Note: Past schedules are removed after processing, so this only contains future schedules. func (k Keeper) GetAllocationSchedule(ctx context.Context) ([]types.ScheduledDistribution, error) {
IMO this should be DistributionSchedule
proto/tx/pse/v1/query.proto line 26 at r1 (raw file):
option (google.api.http).get = "/tx/pse/v1/score/{address}"; }
nit: pls check all files for whitespaces
proto/tx/pse/v1/query.proto line 67 at r1 (raw file):
// QueryAllocationScheduleResponse defines the response type for querying future allocation schedules. message QueryAllocationScheduleResponse {
this query returns SheduledDistributions, so better name for it is either
QueryDistributionSchedule or QueryScheduledDistributions.
It is also more consistent with other places
proto/tx/pse/v1/tx.proto line 23 at r1 (raw file):
// UpdateAllocationSchedule is a governance operation to update the distribution schedule. rpc UpdateAllocationSchedule(MsgUpdateAllocationSchedule) returns (EmptyResponse);
UpdateDistributionSchedule is more correct IMO
35d5dba to
1162161
Compare
1162161 to
11bb9fe
Compare
TxCorpi0x
left a comment
There was a problem hiding this comment.
Reviewable status: 8 of 19 files reviewed, 5 unresolved discussions (waiting on @masihyeganeh, @miladz68, and @ysv)
proto/tx/pse/v1/tx.proto line 23 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
UpdateDistributionSchedule is more correct IMO
The method updates allocations (not paid yet). that is why it is named as AllocationSchedule, in fact it is not distributed yet.
btw, the query PR is the other one. i removed unnecessary queries from this PR
x/pse/keeper/distribution.go line 224 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
IMO this should be DistributionSchedule
Same here, this returns the allocations which is not distributed yet.
btw, the query PR is the other one. i removed unnecessary queries from this PR
proto/tx/pse/v1/query.proto line 26 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
nit: pls check all files for whitespaces
May i define a new task for it to check the nits and fix them all together after the main PRs went through. i see more whitespaces which is not related to this PR concept
proto/tx/pse/v1/query.proto line 67 at r1 (raw file):
Previously, ysv (Yaroslav Savchuk) wrote…
this query returns SheduledDistributions, so better name for it is either
QueryDistributionScheduleorQueryScheduledDistributions.It is also more consistent with other places
I will address it in the related PR (other open)
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 17 of 19 files at r1.
Reviewable status: 8 of 19 files reviewed, 7 unresolved discussions (waiting on @masihyeganeh, @TxCorpi0x, and @ysv)
proto/tx/pse/v1/tx.proto line 23 at r1 (raw file):
Previously, TxCorpi0x wrote…
The method updates allocations (not paid yet). that is why it is named as AllocationSchedule, in fact it is not distributed yet.
btw, the query PR is the other one. i removed unnecessary queries from this PR
I agree with yaroslav, this method should be called UpdateDistributionSchedule.
x/pse/types/genesis.go line 27 at r1 (raw file):
} // Note: No need for ValidateScheduleMappingConsistency since:
the comment seems redundant. feel free to remove it.
x/pse/keeper/params.go line 72 at r1 (raw file):
// Note: All validation is performed in MsgUpdateClearingAccountMappings.ValidateBasic() // before the proposal is stored. This keeper method only handles authority check and state updates. func (k Keeper) UpdateClearingMappings(
UpdateClearingAccountMappings
TxCorpi0x
left a comment
There was a problem hiding this comment.
Reviewable status: 0 of 21 files reviewed, 7 unresolved discussions (waiting on @masihyeganeh, @miladz68, and @ysv)
proto/tx/pse/v1/tx.proto line 23 at r1 (raw file):
Previously, miladz68 (milad) wrote…
I agree with yaroslav, this method should be called
UpdateDistributionSchedule.
Done
x/pse/keeper/distribution.go line 224 at r1 (raw file):
Previously, TxCorpi0x wrote…
Same here, this returns the allocations which is not distributed yet.
btw, the query PR is the other one. i removed unnecessary queries from this PR
Done
x/pse/keeper/params.go line 72 at r1 (raw file):
Previously, miladz68 (milad) wrote…
UpdateClearingAccountMappings
Done
x/pse/types/genesis.go line 27 at r1 (raw file):
Previously, miladz68 (milad) wrote…
the comment seems redundant. feel free to remove it.
Done
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 6 of 11 files at r2, 11 of 14 files at r3, 5 of 5 files at r4, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @masihyeganeh, @TxCorpi0x, and @ysv)
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 6 of 11 files at r2, 11 of 14 files at r3, 5 of 5 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 4 of 4 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 3 of 4 files at r5, 5 of 5 files at r6, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)
miladz68
left a comment
There was a problem hiding this comment.
@miladz68 reviewed 5 of 5 files at r6, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @masihyeganeh)

Description
This pull request introduces new governance operations and query endpoints for managing and retrieving allocation schedules and clearing account mappings in the PSE module. It adds new gRPC query and message types, updates the keeper logic to support schedule replacement, and improves test clarity and error handling. The most important changes are grouped below.
Governance Operations and Query API Enhancements:
QueryAllocationScheduleRequest/QueryAllocationScheduleResponse), with corresponding documentation and proto definitions.MsgUpdateAllocationSchedule) and clearing account mappings (MsgUpdateClearingAccountMappings), including full documentation and proto definitions.Keeper Logic Improvements:
UpdateAllocationSchedulein the keeper to allow governance to replace the entire distribution schedule, with authority checks and validation.GetAllocationScheduleto specify that only future schedules are returned after processing.Testing and Error Handling Updates:
These changes collectively improve the governance flexibility, transparency, and maintainability of allocation schedules and recipient mappings in the PSE module.
Reviewers checklist:
Authors checklist
This change is