canontech / staking-payouts

CLI to make staking payout transactions for Substrate FRAME-based chains
Apache License 2.0
42 stars 13 forks source link

Wish: Support for nominator stashes #54

Open TheGoldenEye opened 3 years ago

TheGoldenEye commented 3 years ago

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

emostov commented 3 years ago

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.

TheGoldenEye commented 3 years ago

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.

TheGoldenEye commented 3 years ago

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.

emostov commented 3 years ago

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