Skip to content

Add the fee for loading the contract into memory #2777

@maxzaver

Description

@maxzaver

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.

Metadata

Metadata

Labels

A-transaction-runtimeArea: transaction runtime (transaction and receipts processing, state transition, etc)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions