-
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
Alter display info of Staking summary overview #7179
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I "get" it. The numbers I would love to see on the overview page (number of actives) are now missing and nowhere to be found. (These numbers are on the targets page as well, with averages)
So while I really appreciate it, and certainly see a need to improve the displays, I'm not sure this is it since it (a) duplicates already available information & (b) removes other useful information.
Critically, there is a performance issue here, it burns the CPU, eating up one of my cores.
I disagree: The numbers that most users want to see is the answer to:
The count of nominators, waiting etc. are metrics that you, I, other devs, or at most active community members are interested in, and while they should exist, they need not be in the main page. Our plan is to:
Both of the numbers that are displayed as a part of this PR can be 100% deduced from the list of validators and their backers ( |
I think I know where the performance issue may come from. I will fix this. |
I'm sorry to disagree here - the info for min stake is there, explicitly with additional on-chain data around it. It may make sense to also display it on the "actions" page, but sadly as it stands we lost info and duplicated others. I am not disagreeing that we can expand the info display, but certainly we should not drop stuff and replace with duplication of already available information (and what is dropped here gets fetched anyway since stuff loads in the background, expensive or not) TL;DR This is a step backwards from what is there, with all the best intentions. Moving info is fine, just dropping without looking at the various areas is not. (As said there are certainly things that fit better elsewhere and vice versa) |
Thinking out loud, maybe we are trying to fit a square peg into a round hole. What about the following approach -
This seems better than trying to shoehorn everything into the single top-bar? |
I understand your concern, but bare in mind that this PR is part of a 2 step PR group. If and when we deliver the second one as well, no information will be "dropped", and it will all be grouped together in a (perhaps opinionated) better way. For example, where
I like this idea a lot, just worried about the duplicate data queries. For example, deducing If this is fine, I am onboard your suggestions, with the minor tweak to call (the new) Also, as a suggestion, in the new All in all though, this seems like a lot more work to deliver. Given the fact that I personally find the information that we added in the front page now much more valuable than what was already there, I am still in favor of accepting this PR as an interim solution, until someone delivers the new overview page. |
There is no duplicates -
EIDIT: On the last point, not everything is memoized, there are some exceptions on the RPCs, e.g. the |
@wirednkod has there been any further updates on this? WDYT? |
The bagsList fallback won't be removed anytime reasonable, which is why we have the detection in-place, e.g. use detected & detect pallet. The apps UI has to lag any removals by a very long time (in the order of 9+ months before even looking at deprecations), since teams do different things. The same goes for new features, anything old cannot just be dropped, even if it is fully deployed on Kusama/Polkadot - even between these 2 there is also some lag. This just compounds with the number of different teams out there, hence we are not looking at delay between these 2, but rather across the ecosystem. |
Fixed |
Something small, another network - http://localhost:3000/?rpc=wss%3A%2F%2Fautomata.api.onfinality.io%2Fpublic-ws#/staking (some parts just keep spinning, I'm guessing because there are no nominators?) Dock has the same issue - http://localhost:3000/?rpc=wss%3A%2F%2Fmainnet-node.dock.io#/staking (although they do have nominators, so the above one may not be caused by that) |
Running this:
In the developer's screen of Im not sure on how to solve this. Any suggestions @jacogr @kianenigma ? |
It is basically optional - if not available, just don't show that specific information. All the max/min stuff is very new, unless the chains follow Substrate master closely, which basically only a handful does, it won't be there. So it needs to be able to gracefully degrade. Teams generally deploy and keep it like that for a long time (only with new features on own pallets), since upgrading Substrate is seen as a PITA. (And yes, I purposefully use "very" above, for Kusama/Polkadot it may feel old by now) PS: Dock POS is actually a surprise to me, since their POS network is relatively new. (A restart/recreate of the old POA version) |
That was the approach I was thinking, but unfortunately at the moment when one value is |
So to detect if not available, assuming const maxValidatorsCount = useCall(api.query.staking.maxValidatorsCount);
...
return (
{api.query.staking.maxValidatorsCount
? maxValidatorsCount
? formatNumber(maxValidatorsCount)
: <Spinner />
: '-'
}
); |
Automata is a bit of a pesky example here: they have pallet-staking in their runtime, but pretty much unused (probably by mistake). So almost no storage item is set in there. Might be a bit difficult to handle that case. |
I have resolved the Dock PoS case, but the This timer will exist only in the In case of - for a peculiar reason - an api call is delayed more than 10 seconds, then (after timer changes This last commit can be reviewed separately and addresses the case of |
Yes, I would revert the hack, it just feels incorrect and smelly :( Don't have a better idea atm, however need to look at the specific loading stuff (with the other fix in), to have some ideas. (Not sure why here, like in the current summaries, it enforces these to be shown, so would need to look with the other fix in, which simulated the same behavior here) |
Will do
Well it is. The case though here is that it feels that they are not using the pallet correctly - I mean - I know the non-stop-turning loaders does not look good, but should UI care about the mis-configuration/usage that one does?
Which fix you refer to? |
The "other fix" I referred to is for Dock. And yes, the UI should care about loading spinners - in the cases where it cannot deal with the info, it should not display anything. Graceful fallback aka feature detection should come into play. Automata + the current summaries is a good example - it just skips display of some values which is it cannot make sense of. (Completely skipping is always better than displaying "-", although it certainly is not consistently followed...) As soon as we have loading spinners and broken displays, we get support requests since people do use this stuff. Support requests are not great to wake up to, so really don't want to create the opportunity for additional ones in the queue. (And anything that looks like a broken UI, no matter what the reason, will generate support requests in large numbers) |
Thank you for the elaboration @jacogr . Having said that, and back to the "UI problem and solution", the issue I see here:
is that we cannot be aware if an API call is finished or
Could not agree more to that - Trying to figure out a solution that will not meddle WAY too much with the current code, but cannot think of one - any pointers that could help on the direction that would fit best? |
const result = useCall(api.query.willNever.beThere) It won't ever return a result for that specific one. In that case, UI-wise - <div>
{api.query.willNever?.beThere && formatNumber(result)}
</div> The staking interfaces are really all-over the show when you look at the ecosystem, so in a wide variety of cases some queries just won't be there - generally since they are "relatively new". (And for those, it should just not display the specific info). If the query is in the runtime, it will always return a result. (It could be the metadata default value if nothing in storage, but something does come back - unless there is a type decoding error, which luckily now happens very infrequently since most teams have moved to metadata v14) |
b3655a6
to
c3122b2
Compare
Hey @jacogr I tried to address the case with a simpler approach. WDYT? cc @kianenigma |
Looking forward to see this merged! |
@jacogr Kind reminder |
Another one :) |
If this is ever going to be merged, this quarter is the best time since we are releasing many new features for staking. |
I think this is still relevant a good improvement :) |
@kianenigma is this PR still as relevant as it was at the time of your last comment? |
I think we should either:
|
Based on this there will be 2 PRs for altering the Overview staking summary area.
This PR addresses the minified version (can be seen below):
cc @emostov @kianenigma (please some support on the outcome numbers)