-
Notifications
You must be signed in to change notification settings - Fork 622
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
Re-evaluate EVM host functions using new param estimator #4778
Comments
As per discussion with @matklad a week ago (I should've updated this, thats on me), he ran into an issue and will let me know when this is ready for us to re-run the param estimator. |
The costs we use today are:
My understanding is that they were estimating using this code (the numbers line up with the ones from #4548). The costs I get locally with the new estimator using our standard approach to estimation (via wasm contract) are:
Command to reproduce this numbers locally: # switch to in-progress estimator branch
$ git clone git@github.com:matklad/nearcore.git && cd nearcore
$ git switch --detach 13faa28d4fce661ec674ab8cb458fc7a711c52fe
$ cargo run --release -p runtime-params-estimator --features required -- --docker --v2 --full \
--metrics-to-measure Ripemd160Base,Ripemd160Block,EcrecoverBase These "new estimator" costs roughly match the "old estimator" costs from #4548. The ecrecover cost is substantially lower in my estimates (10x) than what we currently use. This is explained in #4548 (comment), the new cost is correct, the old cost is too big due to erroneous benchmark. So, action item for aurora team: lower EcrecoverBase cost to ~93*10**9 (per multiplier). See #4795 for cost lowering process (this requires a protocol upgrade). The ripemd costs are higher in my estimate. That's because "wasm contract" approach is conservative -- it effectively summs the costs of hash computation and reading the input. Manually adding those costs to our current costs (while accounting for block/byte distinction) gives numbers similar to my estimates. So, while the estimator gives a higher number, this is OK, as it is, by design, an overestimation. Note that, we do charge both Ripemd160Base and ReadMemoryBase when running the host function, and the same for per byte costs. To sum up, the cost we currently use for Action items for contract runtime team:
I am going to close this issue, feel free to open a follow up for EcrecoverBase upgrade! |
Stabilize features lowering costs for new release: * #4795 * #4865 Quality control: * We run param estimator several times and got consistent results: * beginning of Sep 2021, my GCP instance https://hackmd.io/w6ODyKjUReuuofXTuqdyFQ * end of Sep 2021, @matklad instance #4778 (comment) * The current fee values are explained: * Data receipt costs - investigated here #4482, the reason was relatively explained and the observed issue was fixed. Note that we don't know the exact root cause, but we assume that it is related to a separate fee (touching_trie_node) for taking store size into account. This fee is problematic because it assumes the constant height of a trie, but we treat it as a separate problem. * Ecrecover cost - follow links from this one: #4778 (comment)
@matklad is working on new param estimator and he has an intermediate result. It is much more intuitive and diagnosable. We should re-evaluate EVM host functions using this param estimator and see if the fees are getting reduced.
The text was updated successfully, but these errors were encountered: