Interface GasCostModel


public interface GasCostModel
A specification of the cost of gas.
  • Method Details

    • ramCostOfObject

      int ramCostOfObject()
      Yields the RAM cost of an object, without considering its fields. Hence, this is a constant, not depending on the size of the object.
      Returns:
      the cost
    • ramCostOfField

      int ramCostOfField()
      Yields the RAM cost of a single field of an object allocated in memory. This does not consider the objects reachable from the field, if any.
      Returns:
      the cost
    • ramCostOfArraySlot

      int ramCostOfArraySlot()
      Yields the RAM cost of a single element of an array.
      Returns:
      the cost
    • ramCostOfArray

      int ramCostOfArray()
      Yields the RAM cost of an array, without considering its elements. Hence, this is a constant, not depending on the length of the array.
      Returns:
      the cost
    • ramCostOfActivationRecord

      int ramCostOfActivationRecord()
      Yields the RAM cost of an activation record, without considering the variables therein. Hence, this is a constant, not depending on the number of local variables inside the activation record.
      Returns:
      the cost
    • ramCostOfActivationSlot

      int ramCostOfActivationSlot()
      Yields the RAM cost of a single variable inside an activation record.
      Returns:
      the cost
    • ramCostForInstallingJar

      BigInteger ramCostForInstallingJar(int numBytes)
      Yields the RAM gas cost for installing in store a jar consisting of the given bytes.
      Parameters:
      numBytes - the number of bytes of the jar
      Returns:
      the cost
    • ramCostForLoadingJar

      BigInteger ramCostForLoadingJar(int numBytes)
      Yields the RAM gas cost for loading from store a jar consisting of the given bytes.
      Parameters:
      numBytes - the number of bytes of the jar
      Returns:
      the cost
    • cpuCostOfArithmeticInstruction

      int cpuCostOfArithmeticInstruction()
      Yields the CPU gas cost of the execution of an arithmetic instruction.
      Returns:
      the cost
    • cpuCostOfArrayAccessInstruction

      int cpuCostOfArrayAccessInstruction()
      Yields the CPU gas cost of the execution of an array access instruction.
      Returns:
      the cost
    • cpuCostOfFieldAccessInstruction

      int cpuCostOfFieldAccessInstruction()
      Yields the CPU gas cost of the execution of a field access instruction.
      Returns:
      the cost
    • cpuCostOfInvokeInstruction

      int cpuCostOfInvokeInstruction()
      Yields the CPU gas cost of the execution of an invoke instruction.
      Returns:
      the cost
    • cpuCostOfSelectInstruction

      int cpuCostOfSelectInstruction()
      Yields the CPU gas cost of the execution of a select instruction.
      Returns:
      the cost
    • cpuCostOfMemoryAllocationInstruction

      int cpuCostOfMemoryAllocationInstruction()
      Yields the CPU gas cost of the execution of a memory allocation instruction. This is a constant, that does not consider the size of the allocated object. That size is charged instead in terms of RAM allocation, through instrumentation code.
      Returns:
      the cost
    • cpuCostOfInstruction

      int cpuCostOfInstruction()
      Yields the CPU gas cost of the execution of an instruction that does not fall in any more specific category.
      Returns:
      the cost
    • cpuCostForInstallingJar

      BigInteger cpuCostForInstallingJar(int numBytes)
      Yields the CPU gas cost for installing in store a jar consisting of the given number of bytes.
      Parameters:
      numBytes - the number of bytes of the jar
      Returns:
      the cost
    • cpuCostForLoadingJar

      BigInteger cpuCostForLoadingJar(int numBytes)
      Yields the CPU gas cost for loading from store a jar consisting of the given number of bytes.
      Parameters:
      numBytes - the number of bytes of the jar
      Returns:
      the cost
    • cpuBaseTransactionCost

      BigInteger cpuBaseTransactionCost()
      Yields the CPU gas cost for starting the execution of a transaction.
      Returns:
      the cost
    • storageCostOfByte

      BigInteger storageCostOfByte()
      Yields the storage gas cost for storing a byte in the database. This applies to requests and responses, that get stored into the database of a node.
      Returns:
      the cost