polkadot-js / apps

Basic Polkadot/Substrate UI for interacting with a Polkadot and Substrate node. This is the main user-facing application, allowing access to all features available on Substrate chains.
https://dotapps.io
Apache License 2.0
1.73k stars 1.51k forks source link

Update polkadot.js UI for coretime #10285

Open seadanda opened 4 months ago

seadanda commented 4 months ago

More information

Currently in the Network->Parachains tab there are four tabs: Overview, Parathreads, Auctions, Crowdloans.

I would suggest as a starting point that the auctions and crowdloans tabs be removed, and the parathreads tab be changed to a parachains tab. (parathreads is no longer a relevant term). The following tabs might belong on the relay chains or coretime chains.

A rough structure could then be:

Overview

Parachains

Registered parachains showing:

Bulk sales

More details specifically about bulk coretime sale

On-demand

It's a bit harder to think of what to show here that isn't already on the overview

Additional functionality for the coretime chain

Adding UIs for the following most-used extrinsics at a minimum would be useful:

Core acquisition

Region manipulation

On-demand pool

On-demand acquisition

Storage management (free from any origin)

These could be listed from the chain state when past the point where they can be dropped and dropped in batches or one by one.

This is just a starting point and by no means the best layout or content that we could have. All feedback and ideas are welcome!

vyto2021 commented 4 months ago

It does make sense

chungquantin commented 4 months ago

Hi, is this issue open for outside contributors? I am really interested in contributing to this issue.

seadanda commented 4 months ago

I'm sure outside contributions would be very welcome, I'd advise maybe tackling this issue in smaller chunks to keep the core devs in the loop of where it's up to. @TarikGul any input?

TarikGul commented 4 months ago

I'm sure outside contributions would be very welcome, I'd advise maybe tackling this issue in smaller chunks to keep the core devs in the loop of where it's up to. @TarikGul any input?

I totally agree contributions are very welcome, that being said as you mentioned it would, and should be in small chunks.

Until finished it's probably best if it sits within some experimental tag, but also would require guidance from us as to what should be the order of operations in terms of tasks, and how it should be designed.

chungquantin commented 4 months ago

@TarikGul @seadanda Got it! So what should be a next step from my end. Should I break down the feature into smaller chunks or the core team will be the one who manages to do it?

TarikGul commented 4 months ago

@chungquantin Yea I will post a set of sub-tasks soon that can get done with the following issue. For now I am going to get it started by removing the Parathreads tab from the UI as requested from the core-team then we can work from there :)

Thanks for you patience.

TarikGul commented 3 months ago

For starters I am thinking we should instead have a Coretime (Experimental) where we can iterate on the new coretime UI without having to remove and play with any existing tabs (for now).

@seadanda Can you share with me a link to the new logic, and storage calls for parachains? Also what do you think about the idea above?

seadanda commented 3 months ago

Having an experimental tab sounds good. The other tabs are necessary until all chains upgrade to coretime. Rococo and Westend don't need them any more, Kusama should be upgraded soon, but Polkadot will need them for the next few months.

The storage calls are split between the Relay in the coretimeAssignmentProvider and onDemandAssignmentProvider pallets, and the broker pallet on the Coretime Chain. Bulk is sold, allocated, transferred etc on the coretime chain all through the broker pallet, so that's where you'll get all the pricing information and meta information from. The coreDescriptors and coreSchedules outline only what is running on each core, the mask and when, not how the coretime was purchased.

To list all parachains currently on a bulk core you need to hit the coreDescriptors on the relay, for future ones it's the coreSchedules. To find out the reason they have a core (reservation/lease/normal bulk) you'll need to check broker.reservations, broker.leases and infer that the remaining parachains on a core are "normal" bulk. You can check broker.regions to see what has been bought and what is yet to be allocated. Parachains who are allowed to renew are in the broker.allowedRenewals For on-demand you'll need to check on the relay chain in the onDemandAssignmentProvider onDemandQueue and paraIdAffinity. Currently the credits are unimplemented, but at some point in the future you should be able to check how many coretime credits a given account has. Currently they are just bought directly with the native token.

The sale structure and some other characteristics are defined in the broker.configuration. The prices of bulk coretime and other details for the current sale are in the broker.saleInfo but need to be partially inferred (e.g. if we're within the lead-in period the current price needs to be calculated according to the implementation in the PriceAdapter defined in the runtime.

I hope this helps. It's a complex change, so there's no real way to fully explain it in a comment, I think there's a lot more to be gained by poking around in the state of those three pallets:

But I've tried to provide enough info for a start to be made.

I'm not sure I know what you mean about the new logic. Are you talking about the code for the extrinsics or some docs for something in particular?

TarikGul commented 3 months ago

@seadanda Thanks so much for the explanation its super helpful.

I'm not sure I know what you mean about the new logic. Are you talking about the code for the extrinsics or some docs for something in particular?

Yea for this i mostly meant where the code for the extrinsics and storage exists.

@bee344 is going to help out with the so we can prioritize it and help make progress.

bee344 commented 3 months ago

@seadanda @TarikGul @IkerAlus So the current workplan is to split this into a few PRs, since it's a big task and to gather some feedback on the design and UX along the way. A new tab called Coretime (Experimental) will be added to the Network item, with the following labels:

At first, the Parachains name will be duplicated on the Coretime tab and in the Parachains tab itself, and it will be confusing, so I'm leaving that for last. The naming will work while on development, but I think we'll have to name it differently when it's ready for release, at least until we can get rid of the Parachains tab.

That's the plan for now, but it'll surely evolve as we get deeper into development.

IkerAlus commented 3 months ago

@bee344 I agree with the approach at high level. Let's focus on the overview tab first.

Afterwards, I think most of the Bulk and onDemand relevant info will be found in the Coretime Chain, hence, it may make sense to show this info only when connected to the Coretime chain, while the interface for the Relay chain is limited to current core usage and timelines. Tagging @seadanda in case my understanding is wrong.

bee344 commented 3 months ago

@seadanda one question regarding onDemandQueue and paraIdAffinity: currently those are not in use, right? I'm not getting any info from those calls

castleic commented 1 month ago

I am not a professional developer but I think this feature should be implemented. That demonstrates the unique features of the network.