paritytech / polkadot-sdk

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

Missed Reward Payout batch transaction in KUSAMA for era 6804 #4913

Closed jimiflowers closed 1 week ago

jimiflowers commented 1 week ago

Hi team.

At block height 23838328 (https://kusama.subscan.io/block/0xB819BC43CB46892211E3282759F7C6D4F16BFB14F0B6AF146D7B7FCC29CF09D2) a batch transaction with payout for eras 6804 and 6805 in the extrinsic 0xa675b335db056a4295767fa60b89d47cc84a272e040d842676bbd03b69d7c4cc that was sent by account HRvZ3oB2AzyzszK4Gem1y8zWMuGMJ936mwTCLtpH7CyQ8YX.

The validator's (J4qpdWn4UnBk1UG2SLQwaahrmgHgsgaQrJanMB6qmSCx3wH) commission rewards for the era 6805 was paid but for era 6804 were missed. I can see the "Staking (Rewarded)" event for the era 6805 (https://kusama.subscan.io/extrinsic/23838328-6?event=23838328-178) but not for the era 6804 sent in the same extrinsic.

I have activated notifications in the "SubVT Kusama Bot" that confirmed the payout was sent (I know this is nothing official) imagen

And if I try to claim the payout again the system said it is already done imagen but rewards cannot be seen in the rewards account: https://kusama.subscan.io/account/DMhZfzNXsrhn2qX3XzBezgNRKvGTvfo7iGYMsz9FehXpHrz?tab=reward

Am I missing something?

Regards

bkchr commented 1 week ago

CC @Ank4n @gpestana

Ank4n commented 1 week ago

@jimiflowers This got my head scratching as well. But it seems the validator J4qpdWn4UnBk1UG2SLQwaahrmgHgsgaQrJanMB6qmSCx3wH did not receive any era reward points for era 6804. Whenever a validator creates a non-uncle block they are allotted 20 points and based on these points at the end of era, reward is distributed. I am not sure if any UI shows this clearly but you could query this in polkadot js app.

Since your validator had 0 points for era 6804, there was nothing to reward. The chain does not emit events when payout is 0.

image Your validator has reward points for era 6805 (not shown in screenshot but it is missing for era 6804).

jimiflowers commented 1 week ago

Hi @Ank4n, thanks for your answer.

It's the only thing I thought about when I investigated the case, but it didn't seem credible to me because I've never seen it (six sessions, a complete era, without receiving a single point??). I will verify that no points were really given to the validator in era 6804 and thus we will clear up any doubts.

In any case, if this were the case, maybe it would be more coherent, at a functional level, for a reward of 0.000KSM to be issued so that at least there would be evidence that the payout process has been carried out correctly, even if no amount is required to be paid.

Don't you think?

kianenigma commented 1 week ago

Do you have evidence that your validator has authored any blocks in the aforementioned era where it had no points?

Note that points also come from parachain validation rewards, and those can have much more variability.

Adding an event in the case of 0 reward sounds like a good improvement.

jimiflowers commented 1 week ago

No, I have no evidence of blocks authored by this validator, cos I also think, after reviewed all proofs, that the issue was this. The validator was active at era 6804 cos nominated by 1KV account, but it authored 0 blocks (honestly, It's the first time I see this behaviour in a validador, 0 points for a complete era).

image

I close the ticket, thanks for your support!

jimiflowers commented 1 week ago

Solved with the proposal of adding a 0.000 rewards event to avoid this type of confusion.

Overkillus commented 1 week ago

In one kusama era (6h) there's 6 60 10 = 3600 block authoring opportunities.

With some major simplifications because it is probabilistic it give you a 2.7% chance to not author a single block despite being an active authority for a full era.

Block authoring is only a small sliver of your rewards though. image

Most of them right now come from backing. In kusama not all active validators are chosen for parathread validation (become backers etc). Out of 1000 active validators 400 are chosen. I can double-check later but assuming it's random it gives you 4.5% chance to never get into the pool of 400 (they are rerolled every 1h).

So in total there's a 4.5% * 2.7% = 0.1215% chance to get 0 rewards even tough you are a perfectly well-behaving active validator.

image (https://apps.turboflakes.io/?chain=kusama#/insights)

I hope that in the future the difference between active validators (1k) and parathread validators (400) will get narrower so this should happen even rarer or even never.

Edit: Made a mistake in the math. Chance is even lower and will be around 0.1215% so 1:800 odds.