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

Add the fee for loading the contract into memory #2777

Closed
MaksymZavershynskyi opened this issue Jun 3, 2020 · 3 comments
Closed

Add the fee for loading the contract into memory #2777

MaksymZavershynskyi opened this issue Jun 3, 2020 · 3 comments
Assignees
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc)

Comments

@MaksymZavershynskyi
Copy link
Contributor

We should add the fee that reflects the cost of compiling and loading the contract into memory.
The fee should consist of the base cost and the cost per byte. Currently, the base cost of compiling and loading the contract is already represented by function_call_cost (https://github.com/nearprotocol/nearcore/blob/0456008492e57612e44b994aa75519a03606874c/runtime/near-runtime-fees/src/lib.rs#L152), however we don't have a cost of calling a contract per byte size of the contract. (Note, function_call_cost_per_byte is the cost per byte of the arguments).
This fee should be encapsulating the worst case, when there are no caches and the contract is compiled and loaded into the memory on each single invocation.

@MaksymZavershynskyi MaksymZavershynskyi added the A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc) label Jun 3, 2020
@olonho
Copy link
Contributor

olonho commented Jun 4, 2020

We agreed that Willem will take a look on that, and I will assist as needed.

@bowenwang1996
Copy link
Collaborator

@willemneal this is done right?

@willemneal
Copy link
Contributor

Yep by #2845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-transaction-runtime Area: transaction runtime (transaction and receipts processing, state transition, etc)
Projects
None yet
Development

No branches or pull requests

4 participants