-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Brace for the new reward logic in nomination pools #7741
Comments
This is about to be baked into the 9.26 release pretty soon FYI https://polkadiff.parity.io/ |
Thank you. May have to disable it as detected until support is in. |
FYI, even though you said it won't be handy, I am adding this: paritytech/substrate#11831 The transaction to claim rewards is exactly the same as before. We could also add a endpoint that returns the pool's total pending reward. You can re-implement the logic on your side, but RPC sounds much more sustainable to me. |
This will probably make it to 9.27 |
If you say this will help you, I will see if we can add the RPC in 9.26 as well. |
fwiw, here's an example of how to compute the pending rewards in JS (using overflow prone vanilla number type): Once paritytech/substrate#12095 is merged (9.29), you can use this RPC. |
The UI currently does retrieve rewards using the runtime call, but as suggested above (after this fix in API 9.3.1 which seems to have pointed to pre-merge PR status), however it is not quite working on Westend for me at least (everything is always 0 at this point, even with unclaimed pool rewards). Usage here - apps/packages/page-staking/src/Actions/Pool/useAccountInfo.ts Lines 23 to 31 in 16d1be3
|
If you want to support it now (which I encourage you do), you should use something along the lines of the link above: https://github.com/substrate-portfolio/polkadot-portfolio/pull/16/files#diff-17782fa0982182d57be83b90b00797e4ef1da85220c6780e23e310f272389aecR225 Once 9.29 is enacted, we will have the runtime API working again. |
Thanks for confirming. my observations I will close this then since the UI does support the correct logic to cater with rewards. Obviously because of an oversight this is not quite working as of yet (it happens) however it seems the runtime call bug has been addressed - once that is in, the UI will "just work, no adjustments" since the runtime is now properly treated as "the source of truth". PS: Putting in code to work around bugs and then removing it is not quite maintainable with multiple runtimes. And even with the link, I do have my own implementation that was reverse-engineered, however maintenance-wise this is a dead-end and it it not going in. I would just suggest getting the fixed into the networks as a priority, starting with Westend. (Other codebases may obviously have differing opinions on this and be willing to pay the long-term maintenance price of "either this or that since we cannot trust the runtime", I just believe the cause needed to be fixed instead of plastered over.) Thanks for the pointers and especially the runtime interfaces which is "the right way to go(tm)", this would be great when fully enabled and runtime, no-bug functional on all relay chains. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query. |
As described in paritytech/substrate#11669, the logic for how the rewards are computed is changing in a non-compatible way. This needs some catering for, until all chains are updated with the new logic.
The text was updated successfully, but these errors were encountered: