canontech/staking-payouts

Wish: Support for nominator stashes

Opened this issue · 4 comments

It would be nice to be able to do the payouts for nominator stashes as well

I will plan on working on this at some point in the future - the feature will likely be quite slow though.

I would also like to add support for simply viewing pending payouts for a validator or nominator stash address.

Hi Zeke, thanks for the quick solution.
Unfortunately it is not quite what I wanted.
Your code determines the nominated validators of the current era and adds them to the validator list.
This is no longer valid when the nominations change (at least for the older eras).
In addition, payouts are claimed in eras for which I have no rewards (due to the inactive nominations).
The nominated validators should instead apply only per era, not in general.
Furthermore, only active nominations should be considered.

Example:
An account nominates 5 validators. The active nomination (in era 2344) was for JHDDYty2cU6vjWyMF2kvNK9hRMAgH9THwqvQpUzqQQs7KJr.
The output of "staking-payouts" looks like this:

2021-06-07 13:54:07 [payouts] info: The following unclaimed payouts where found: 
staking.payoutStakers(GWmJ7Wb93aDL1VcN5AW7VfzNyiRASpwaGu2zc1uNriwEj3h, 2,344)
staking.payoutStakers(G7Pg8TMoQpHDQNq27bb6CTB4uzyk2ccq7poJwQsojNbsipV, 2,344)
staking.payoutStakers(Hv8d8xLhJTTggzMCR3oUgmqCgQYuNfUu7syq7q1Lo9cAXg2, 2,344)
staking.payoutStakers(FFc4enhqqTkkwpec2HmH42fzrUGqNN3Qwu4U2aox5W2ArLx, 2,344)
staking.payoutStakers(JHDDYty2cU6vjWyMF2kvNK9hRMAgH9THwqvQpUzqQQs7KJr, 2,344)
2021-06-07 13:54:07 [payouts] info: Total of 5 unclaimed payouts.
2021-06-07 13:54:07 [payouts] info: Exiting ...

I would have expected only staking.payoutStakers(JHDDYty2cU6vjWyMF2kvNK9hRMAgH9THwqvQpUzqQQs7KJr, 2,344) to be paid out.

Yeah, I agree. Will try to make sure we only do payouts for eras when then nominator was actively backing the validator.