Skip to content
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

[WIP] Base weights for Host implementations #49

Closed
wants to merge 11 commits into from
Closed

Conversation

lamafab
Copy link
Contributor

@lamafab lamafab commented Jul 22, 2022

This is based on paritytech/substrate#10918

This draft still needs more work, explanations and numbers, especially regarding bandwidths. On polkadot's side there's a branch regarding this that hasn't been worked on in months. I'll leave this open for now and will continue on this once the implementation respectively the design decision is clearer.

Preview: https://github.com/w3f/PSPs/blob/weights/PSPs/drafts/psp-49.md

@xlc
Copy link
Contributor

xlc commented Jul 23, 2022

what’s the purpose of this? this looks like a documentation rather standard proposal. why placing all the actual numbers here that are subject to change?
and it is all about weight v1 instead v2

@lamafab
Copy link
Contributor Author

lamafab commented Jul 23, 2022

I think the motivation section makes the purpose of this quite clear?

The Substrate implementation determined weights based on the resources that it provides to the Runtime for consumption, such as I/O, computation and network bandwidth. Given that alternative implementations are available and can be developed in the future, those weights should be reflected by those alternative implemenations so that the fee structure is justifiable for the diverse network of participants at large. The goal is to avoid situations where alternative implemenations are too strict or too loose in terms of costs of their resource requirements which could lead to bad economic outcomes and a fractured network of implemenations.

Basically, Hosts that execute the Runtime should roughly know what the expected overhead of the database, etc, is. I'm aware those numbers are subject to change, but they don't get updated often and will most likely even become more conservative as time goes on. Also, as mentioned above, bandwidth weights are still missing and the inner details of the the weight structures/systems are not relevant here given that the Runtime handles that stuff (and Substrate devs), not the Host.

Also, this was first written for our spec, I proposed to make it a PSP. But maybe it should actually be in the spec instead.

@lamafab lamafab changed the title [WIP] Weights V2 Draft [WIP] Base weights for Host implementations Jul 23, 2022
@xlc
Copy link
Contributor

xlc commented Jul 24, 2022

The whole reason we automatically benchmark the weights is that we can adjust them easily to reflect new optimizations / recommended hardwares. We do want to make sure the weights are always up to dated.
I can see it is useful to have those number documented but yeah it should be part of the polkadot host implementation spec, not really a standard.
We still don't really have a good idea on what should be included to PSP and sounds like we need to figure it out. In this particular case, I don't think it is suitable here.

@lamafab lamafab closed this Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants