paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.8k stars 652 forks source link

Add Voted event for conviction-voting #5618

Closed vovacha closed 2 weeks ago

vovacha commented 3 weeks ago

Is there an existing issue?

Experiencing problems? Have you tried our Stack Exchange first?

Motivation

I need to monitor voting activity: who voted, when, and how much balance was used. Currently, the conviction-voting pallet does not emit "Voted" event when a vote is cast, making it difficult to monitor governance participation in real-time.

In comparison, the democracy pallet already emits "Voted" event for similar actions. Introducing a corresponding event in the conviction-voting pallet would ensure consistency across governance pallets and simplify tracking these activities.

Relying on extrinsics is not a straightforward task because voting actions can be hidden inside batch calls or obscured by proxy usage, making it difficult to determine the true origin of the vote. Other scenarios, like scheduled calls or unknown to me edge cases, can further complicate extracting accurate information from extrinsics. Continuously querying storage like VotingFor seems inefficient.

Request

I request addition of a "Voted" event in the conviction-voting pallet, similar to the event in the democracy pallet. If this is not feasible, I’d appreciate feedback and any alternative suggestions to achieve the same goal. Depending on the complexity of the final feature (to be discussed). I have the capacity to dedicate several working days to this task. If the scope fits within that timeframe, I may be able to contribute.

Solution

No response

Are you willing to help with this request?

Maybe (please elaborate above)

bkchr commented 2 weeks ago

Yeah feel free to open a pr. I don't think that it will take several days, just some minutes to add this event.

vovacha commented 2 weeks ago

Closing the issue since it's been recently implemented https://github.com/paritytech/polkadot-sdk/pull/4613