-
Notifications
You must be signed in to change notification settings - Fork 137
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
NEP-455: Parameter Compute Costs #455
Conversation
@jakmeier , I've drafted the rest of the sections, adding the main points that need to be covered there. Please take a look if there are any other topics that the NEP should highlight/clarify. I also proposed a new terminology for the weights to make the naming a bit more future-looking. Specifically, I'm thinking of renaming "Parameter Weights" to "Parameter Compute Weights/Factors" to reflect the fact that this is a conversion from gas costs to compute costs. Similarly, I'm thinking of introducing a "Chunk Compute Limit" (specialized "Chunk Gas Limit") for the purpose of limiting the total compute usage in the chunk. |
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.
This is taking on a good shape already. It's a great basis to involve more protocol team members to discuss details.
@jakmeier , in a process of polishing the Summary/Motivation/Spefication sections I came to conclusion that we need to do a bit more thinking around conceptual way we present this idea (as I've struggled to clearly write it down). Here is my latest thinking trying to distill what we want to accomplish even further: The root cause/tension behind underchargings is the fact that we want to use the average operation gas costs for the purpose of charging users (to avoid overcharging them and make their workload costs competetive with other chains), but we want to use safe gas costs for the purpose of limiting the chunk size (to limit the chunk production time in the worst case). We mostly get away with making safe costs equal to average costs (as on average we don't hit the worst case), but in cases when the difference between the two is large (e.g. storage operations) this distinction becomes especially noticeable and calls for action. So another conceptual way to think about this NEP is as an introduction of safe gas costs that approximate the worst case compute costs of operations. Then we will use safe gas costs for the purpose of counting towards chunk gas limit, but still use the existing gas cost for all other purposes (e.g. burning). Overall, I think this is both easier to explain and also cuts to the root of the problem. What do you think? |
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.
@Akashin I had a brief look over it. Left a few small grammar related comments and a thought or two on the content as well. But I think once these details are addressed, this looks ready to be submitted to the WG.
Oh and we should update the title and description to reflect the new name. (Maybe even a quick explanation that it used to be called weights but isn't anymore could be useful in the PR comment.) |
@near/nep-moderators , this NEP is now ready for review. For the context, this NEP was previously named "Parameter Weights" and the idea was originally proposed in https://gov.near.org/t/proposal-gas-weights-to-fight-instability-to-due-to-undercharging/30919. |
Thank you @Akashin for submitting this NEP. As a moderator, I reviewed this NEP and it meets the proposed template guidelines. I am moving this NEP to the REVIEW stage and would like to ask the @near/wg-protocol working group members to assign 2 Technical Reviewers to complete a technical review. If you want to assign yourself, please mention that you are acting as the Technical Reviewers. Please find some guidelines below for completing the technical review. Technical Review Guidelines
Here is a nice example and a template for your convenience:
Please tag the @near/nep-moderators once you are done, so we can move this NEP to the voting stage. Thanks again. |
I nominate @jakmeier and @mzhangmzz as SME reviewers for this NEP. |
@blasrodri indicated on the Protocol Community Group that they will be interested in helping review this NEP. |
@near/nep-moderators As a listed co-author and one of the engineers originally proposing this idea, does it make sense for me to take on the role of an SME? Obviously, I can do it with little effort, given that I have already spent a lot of time discussing this topic with Andrei and others. But I wonder if this makes sense from a process perspective. |
@jakmeier Thanks for flagging that! Indeed, it defeats the purpose of the review. Fortunately, @blasrodri volunteered to help with the review, so together with @mzhangmzz we have 2 SMEs to review this NEP. Thanks for helping to scale the review process! With more participants, we can shard it! 😉 |
@near/nep-moderators , given that this NEP have been approved by reviewers, can we please move it to the voting stage? |
As the moderator, I would like to thank @mzhangmzz and @blasrodri for completing the technical review. Based on your comments above, it seems like this proposal is ready for the working group members for review. @near/wg-protocol – Can you please fully read this NEP and comment in the thread if you are leaning towards approving or rejecting it? Please make sure to include your rationale and any feedback that you have for the author. Once we get 2/3 voting indications, we will schedule a public call for the author to present the NEP and for the working group members to formalize the voting. |
As a working group member, I lean towards approving this NEP. This NEP provides a way to mitigate the risks of undercharging and allow protocol developers to openly discuss undercharging issues without creating security risks. It would be nice to have a way to adjust compute costs dynamically, but I think this NEP is a good first step. |
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.
The PR looks good to me. I left some comments that are not blocking its approval.
As the moderator, I would like to thank @Akashin for submitting this NEP, and for the @near/wg-protocol working group members for your review. Based on the voting indications above, it seems like this proposal is close to a decision. We are therefore scheduling the fourth Protocol Work Group call, where this NEP can enter the final voting stage. Anyone can discuss the technical details by adding your comments to this discussion. And join the call to learn about the final decision and how to get more involved. Meeting Info |
I lean towards approving this NEP. As other folks have mentioned before, it allows us to 'stop the bleeding' (when we discover the undercharging) and buys us time to do the proper fix. The main disadvantage I see, is that it still requires a new release + protocol change -- which might take couple weeks. |
7112035
to
afdbaa5
Compare
Thank you to everyone who attended the fourth Protocol Working Group meeting last Thursday! The working group members reviewed the NEP and reached the following consensus: Status: Approved
Meeting Recording: @Akashin and @jakmeier Thank you for authoring this NEP! Next Steps:
|
@Akashin Are we ready to merge this NEP? I just want to double-check that there are no outstanding last-minute fixes. |
**UPDATE:** This PR has been updated to match the description of Compute Costs NEP: near/NEPs#455 Concretely, now we specify compute costs directly without weights indirection. --------- This PR addresses #8264, in particular allowing to add parameter weights for Storage Costs. Some open questions and potential improvements: - [X] Do we need to surface weights in the `views.rs` (RPC interface of the node?) - [X] Ideally we would avoid specifying the old base value in the diff config if we only want to change the weight. For now we need to do: ```yaml wasm_storage_read_base: { old: { base: 50_000_000_000, weight: 3 }, new: { base: 50_000_000_000, weight: 7 } } ```
Originally the proposal was called Parameter Weights but it was renamed in the process. Includes contributions from: - [email protected] - [email protected] - [email protected] - [email protected]
435fe67
to
8efdfe1
Compare
@frol , I did a few more cleanup steps, folding a large set of older commits into one and answering all pending questions and I think now the PR is ready to be merged. |
NEP for Parameter Compute Costs (formerly known as Parameter Weights).
For the context, this NEP was previously named "Parameter Weights" and the idea was originally proposed in https://gov.near.org/t/proposal-gas-weights-to-fight-instability-to-due-to-undercharging/30919.
Now it's renamed into "Parameter Compute Cost" to more accurately represent the fact that it is about accounting how much compute time the parameters cost and using it to limit the chunk processing time.