-
Notifications
You must be signed in to change notification settings - Fork 641
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
Get rid of with_ext_cost_counter
#5719
Comments
cc @jakmeier |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
This issue has been automatically marked as stale because it has not had recent activity in the last 2 months. |
cc @akhi3030 you might want to look into this one |
@matklad: I spent some time looking into this. An initial question is that https://github.com/near/nearcore/blob/master/runtime/near-vm-logic/src/logic.rs#L2362 Is the goal of this issue to get rid of uses of |
@akhi3030 production code uses this function to write this info, but the only reader of this information is the estimator. So, but removing it from the estimator, we'll make it dead, and could remove it from prod code as well. |
Got it, thanks, makes sense. |
We have this bit of logic:
nearcore/runtime/near-vm-logic/src/gas_counter.rs
Line 12 in f852488
What it does is that it records the cost we charge for in a thread local. We use in the param estimator to make some asserts – basically, we run something, and we sanity check that the expected number of host functions was called. Eg, here:
nearcore/runtime/runtime-params-estimator/src/lib.rs
Line 645 in f852488
1024 * 1024 * 10_000
is used to assert that we indeed read 1 meg ten thousand times.The problem here is that we have a second, better infra for that, ProfileData:
nearcore/core/primitives-core/src/profile.rs
Lines 46 to 52 in f852488
It computes the breakdown of costs for contracts, and is a stable thing which is available via RPC. So, we should port the estimator to profile data
The text was updated successfully, but these errors were encountered: