Emit event on PSE community finalization#113
Conversation
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: 1 of 5 files reviewed, 1 unresolved discussion (waiting on akhlopiachyi, masihyeganeh, miladz68, tx-development, TxCorpi0x, and ysv).
x/pse/keeper/distribute.go line 276 at r1 (raw file):
CommunityPoolAmount: leftover, }); err != nil { return err
Event emission failure here is blocking and will prevent cleanupOngoingDistribution from running, leaving the distribution stuck in a retry loop every block.
Recommendation: Let's align with the existing event err handling pattern and log-and-continue instead of returning the error.
TxCorpi0x
left a comment
There was a problem hiding this comment.
@TxCorpi0x made 1 comment.
Reviewable status: 1 of 5 files reviewed, 1 unresolved discussion (waiting on akhlopiachyi, masihyeganeh, metalarm10, miladz68, tx-development, and ysv).
x/pse/keeper/distribute.go line 276 at r1 (raw file):
Previously, metalarm10 wrote…
Event emission failure here is blocking and will prevent
cleanupOngoingDistributionfrom running, leaving the distribution stuck in a retry loop every block.
Recommendation: Let's align with the existing event err handling pattern and log-and-continue instead of returning the error.
Good Point.
Done
metalarm10
left a comment
There was a problem hiding this comment.
@metalarm10 reviewed 4 files and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on akhlopiachyi, masihyeganeh, miladz68, tx-development, and ysv).
ysv
left a comment
There was a problem hiding this comment.
@ysv reviewed 5 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on akhlopiachyi, masihyeganeh, miladz68, and tx-development).
Description
This pull request introduces a new event to signal the finalization of community token distributions and improves the traceability of distribution events by adding unique identifiers. The changes enhance observability and clarity in the distribution process, ensuring that all relevant information is emitted and documented when distributions are completed.
Event and Distribution Tracking Improvements:
EventCommunityDistributionFinalized, which is emitted when allAccountScoreSnapshotentries have been paid out and the leftover is sent to the community pool. This event includes fields for the scheduled time, distribution ID, total distributed, and leftover sent to the pool. [1] [2] [3]Event Structure and API Documentation Updates:
distribution_idfield toEventAllocationDistributedand ensured it is included in event emission, serialization, and unmarshalling logic for better event traceability. [1] [2] [3] [4] [5] [6] [7]distribution_idfield, providing clear descriptions for API consumers. [1] [2] [3]Internal Refactoring:
ScheduledDistributionobject where needed, enabling access to all relevant fields for event emission. [1] [2]These changes collectively improve the transparency and auditability of the token distribution process.
Reviewers checklist:
Authors checklist
This change is