-
Notifications
You must be signed in to change notification settings - Fork 481
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
How is costing determined? #4375
Comments
I think for the time being we're assuming that the Plutus team will handle determining costing functions. In the future we'd like to encourage contributors to do it, but it's a bit tricky. If you're willing and have time to contribute to this you could probably help by extending the benchmarks here to include the new builtin. Ultimately it's empirical: make some benchmarks, run the function in question with arguments of varying sizes and see what costing function fits. You can omit parts of the domain that cause errors (relevant for signature verification as that means we only care about appropriately-shaped inputs). cc @kwxm |
When the SECP256k1 PR is merged I can work out what the cost model should be. A problem is that to come up with coefficients for costing functions we have to run some benchmarks on a reference machine that's reserved for that purpose, so it's not easy for external contributors to generate the required data. Costing functions also have to be carefully audited before deployment to make sure that the claimed cost of a builtin is accurate in order to avoid scripts which run for much longer than the cost model would have you believe. We will produce a document about this in due course, but other things are currently taking priority. |
@kwxm is there such a document now? Is it accurate regarding what needs to be done in order to determine costing? Is it complete? |
Unfortunately not. We have an internal document that's rather outdated and needs to be updated and tidied up for general consumption. That's another thing that's in the backlog. There's a placeholder in the Plutus Core specification, and it might be worth putting a high-level description of the costing process in there as a stopgap so that people can get some idea of how things work. |
OK, it sounds like this is not being considered high priority at the moment. I'm therefore adding the respective label. |
@kwxm do we now have more docs on costing? Maybe even enough to close this issue? |
Describe the feature you'd like
This relates to #4233, specifically this comment here. Clearly the
mempty
costing is a default, and probably not accurate for the SECP256k1 builtin required by the issue. However, I'm not sure how costing is determined, or what needs to be done to determine it. Is this documented anywhere? If yes, it'd be good to have it more visible; if not, what is the process of costing?Describe alternatives you've considered
Currently, you can define all costs as
mempty
, but this is clearly not accurate, as operations can have very different costs.The text was updated successfully, but these errors were encountered: