-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run mint.BeginBlocker before distr.BeginBlocker #2967
Comments
nope that sounds fine, I don't foresee any issues |
I'm not sure whether this will completely fix the problem since in Lines 15 to 30 in a55f449
So with both of these things combined we could currently have a 2 block lag of inflation. Even though I'm wondering because in the block after the unbonding the calculation/TotalPower should be correct. |
This is a guess of how this went in Gaia-9002. After the genesis validators were unbonded the inflation was still lagging 2 blocks. In the first of these we autobonded and consequently were the ones with the by far highest weight. So we accumulated almost 100% of the Accum in the FeePool in the 2nd block and could get almost all of the inflation which was still extremely large because the inflation module was "lagging behind". That way not only inflation was extremely high for 2 rounds but we were also able to claim almost 100% of the rewards in one of the blocks. |
even mint.BeginBlocker before distr.BeginBlocker,this situation will still happen,because Inflation/AnnualProvisions calculate every 1 hour.Only if a large-stake validator unbonds at Inflation/AnnualProvisions calculate block |
With all these things in mind. I don't think this change is plausible as recalculation of the AnnualProvisions after a large bonded stake change would open a potential DoS vector. I can only imagine that calculating the inflation rate rather than the amount every hour would solve this even though that increases the effective inflation. |
Yes, you are quite correct. In normal situations (no single massive validator unbonding), this doesn't seem too problematic, but in this case it definitely is.
I don't think this matters, calculating the annual provisions is not very expensive at all (a few multiplications) compared to lots of other things we do every block (tracking signing info, for example). I suggest we make this Thoughts @rigelrozanski? |
I want to point out about the global pool distribution logic behind the scene.
Therefore, total rewards for each node is 35.7/21.4/21.4/21.4 Considering the same DelAccum at step 1, the distribution result is somewhat different. Is it a reasonable thing to happen in distribution logic? This logic makes all the validators to withdraw more frequently, result in heavy tx and network costs.
This logic will finally lead to an equillibrium that all the validators withdraw their rewards when their share is greater than 1 stake. It will be eventually a very competitively withdrawing network. |
I also think this is likely - can we discuss on #2764 instead? |
ok. thanks for the link! I can see your reply with similar argument already there. |
Presently we run
distr.BeginBlocker
beforemint.BeginBlocker
- this means that if a large-stake validator unbonds, inflationary rewards proportional to their stake will be paid at the start of the next block (since they're just added to the collected fees inx/mint
, not yet distributed). Can we swap the ordering so said validator will be able to withdraw the fees (which they deserve, since they signed the block)?Any problems with doing this (other than needing to change a few invariants) @rigelrozanski?
The text was updated successfully, but these errors were encountered: