massa-module-cache/gas-table.md
This document keeps track of where and how gas costs are handled for SC executions.
It contains:
| TYPE | PAYMENT |
|---|---|
| CallSC (OP) | |
| compilation | NOT PAID |
| VM instantiation | PAID IN MAX_GAS |
| module instantiation | PAID IN MAX_GAS |
| execution | PAID IN MAX_GAS |
| ExecuteSC (OP) | |
| compilation | PAID IN OP GAS |
| VM instantiation | PAID IN MAX_GAS |
| module instantiation | PAID IN MAX_GAS |
| execution | PAID IN MAX_GAS |
| Call (ABI) | |
| compilation | NOT PAID |
| VM instantiation | PAID IN CALL GAS |
| module instantiation | PAID IN CALL GAS |
| execution | PAID IN CALL GAS |
| base gas cost of the ABI | PAID IN ABI GAS |
| LocalExecution (ABI) | |
| compilation | PAID IN ABI GAS |
| VM instantiation | PAID IN CALL GAS |
| module instantiation | PAID IN CALL GAS |
| execution | PAID IN CALL GAS |
| base gas cost of the ABI | PAID IN ABI GAS |
| CreateSC (ABI) | |
| compilation | PAID IN ABI GAS |
| SetBytecode (ABI) | |
| compilation | PAID IN ABI GAS |
massa-execution-worker > execution.rs > execute_operation by get_gas_usagemassa-execution-worker > execution.rs > execute_readonly_requestmassa-sc-runtime ABI cost by assembly_script_local_execution. This ABI gives rise to Singlepass compilations and must have according costs to pay for it.Paid in massa-sc-runtime ABI costs by assembly_script_create_sc, assembly_script_set_bytecode & assembly_script_set_bytecode_for. These ABIs give rise to Cranelift compilations and must have according costs to pay for it.
massa-module-cache > controller.rs > load_module & load_tmp_moduleload_module is used in every function calling SCs stored on the chainload_tmp_module is used in every function calling arbitrary codemassa-sc-runtimePaid in massa-sc-runtime.