Class/Object

org.ergoplatform

ErgoLikeContext

Related Docs: object ErgoLikeContext | package ergoplatform

Permalink

class ErgoLikeContext extends InterpreterContext

Represents a script evaluation context to be passed to a prover and a verifier to execute and validate guarding proposition of input boxes of a transaction.

Linear Supertypes
InterpreterContext, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ErgoLikeContext
  2. InterpreterContext
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ErgoLikeContext(lastBlockUtxoRoot: AvlTreeData, headers: Coll[Header], preHeader: PreHeader, dataBoxes: IndexedSeq[ErgoBox], boxesToSpend: IndexedSeq[ErgoBox], spendingTransaction: ErgoLikeTransactionTemplate[_ <: UnsignedInput], selfIndex: Int, extension: ContextExtension, validationSettings: SigmaValidationSettings, costLimit: Long, initCost: Long, activatedScriptVersion: Byte)

    Permalink

    lastBlockUtxoRoot

    - state root before current block application

    headers

    - fixed number of last block headers in descending order (first header is the newest one)

    preHeader

    - fields of block header with the current spendingTransaction, that can be predicted by a miner before it's formation

    dataBoxes

    - boxes, that corresponds to id's of spendingTransaction.dataInputs

    boxesToSpend

    - boxes, that corresponds to id's of spendingTransaction.inputs

    spendingTransaction

    - transaction that contains self box

    selfIndex

    - index of the box in boxesToSpend that contains the script we're evaluating

    extension

    - prover-defined key-value pairs, that may be used inside a script

    validationSettings

    validation parameters passed to Interpreter.verify to detect soft-fork conditions

    costLimit

    hard limit on accumulated execution cost, if exceeded lead to CostLimitException to be thrown

    initCost

    initial value of execution cost already accumulated before Interpreter.verify is called

    activatedScriptVersion

    Maximum version of ErgoTree currently activated on the network. The activation is performed via miners voting. For verification of *mined* blocks this parameter should be passed according to the latest voted (activated) script version on the network. However this is not the case for *candidate* blocks. When activatedScriptVersion > Interpreter.MaxSupportedScriptVersion then the interpreter accept script without verification which is not what should happen for *candidate* blocks. This means Ergo node should always pass Interpreter.MaxSupportedScriptVersion as a value of ErgoLikeContext.activatedScriptVersion during verification of candidate blocks (which is a default). The following values are used for current and upcoming forks:

    • version 3.x this value must be 0
    • in v4.0 must be 1
    • in v5.x must be 2 etc.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val activatedScriptVersion: Byte

    Permalink

    Maximum version of ErgoTree currently activated on the network.

    Maximum version of ErgoTree currently activated on the network. The activation is performed via miners voting. For verification of *mined* blocks this parameter should be passed according to the latest voted (activated) script version on the network. However this is not the case for *candidate* blocks. When activatedScriptVersion > Interpreter.MaxSupportedScriptVersion then the interpreter accept script without verification which is not what should happen for *candidate* blocks. This means Ergo node should always pass Interpreter.MaxSupportedScriptVersion as a value of ErgoLikeContext.activatedScriptVersion during verification of candidate blocks (which is a default). The following values are used for current and upcoming forks:

    • version 3.x this value must be 0
    • in v4.0 must be 1
    • in v5.x must be 2 etc.
    Definition Classes
    ErgoLikeContextInterpreterContext
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. val boxesToSpend: IndexedSeq[ErgoBox]

    Permalink

    - boxes, that corresponds to id's of spendingTransaction.inputs

  7. def canEqual(other: Any): Boolean

    Permalink
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val costLimit: Long

    Permalink

    hard limit on accumulated execution cost, if exceeded lead to CostLimitException to be thrown

    hard limit on accumulated execution cost, if exceeded lead to CostLimitException to be thrown

    Definition Classes
    ErgoLikeContextInterpreterContext
  10. val currentErgoTreeVersion: Option[Byte]

    Permalink

    Current version of the ErgoTree executed by the interpreter.

    Current version of the ErgoTree executed by the interpreter. This property is used to implement version dependent operations and passed to interpreter via special.sigma.Context. The value cannot be assigned on ErgoLikeContext construction and must be attached using withErgoTreeVersion() method. When the value is None, the InterpreterException is thrown by the interpreter.

  11. val dataBoxes: IndexedSeq[ErgoBox]

    Permalink

    - boxes, that corresponds to id's of spendingTransaction.dataInputs

  12. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. def equals(other: Any): Boolean

    Permalink
    Definition Classes
    ErgoLikeContext → AnyRef → Any
  14. val extension: ContextExtension

    Permalink

    - prover-defined key-value pairs, that may be used inside a script

    - prover-defined key-value pairs, that may be used inside a script

    Definition Classes
    ErgoLikeContextInterpreterContext
  15. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Permalink
    Definition Classes
    ErgoLikeContext → AnyRef → Any
  18. val headers: Coll[Header]

    Permalink

    - fixed number of last block headers in descending order (first header is the newest one)

  19. val initCost: Long

    Permalink

    initial value of execution cost already accumulated before Interpreter.verify is called

    initial value of execution cost already accumulated before Interpreter.verify is called

    Definition Classes
    ErgoLikeContextInterpreterContext
  20. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  21. val lastBlockUtxoRoot: AvlTreeData

    Permalink

    - state root before current block application

  22. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. val preHeader: PreHeader

    Permalink

    - fields of block header with the current spendingTransaction, that can be predicted by a miner before it's formation

  26. val self: ErgoBox

    Permalink
  27. val selfIndex: Int

    Permalink

    - index of the box in boxesToSpend that contains the script we're evaluating

  28. val spendingTransaction: ErgoLikeTransactionTemplate[_ <: UnsignedInput]

    Permalink

    - transaction that contains self box

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. def toSigmaContext(extensions: Map[Byte, AnyValue] = Map()): Context

    Permalink

    Creates special.sigma.Context instance based on this context.

    Creates special.sigma.Context instance based on this context. The created instance contains all data represented using types form special.sigma package. These types are used internally by ErgoTree interpreter. Thus, this method performs transformation from Ergo to internal Sigma representation of all context data.

    extensions

    additional context variables which will be merged with those in the extension of this instance, overriding existing bindings in case variable ids overlap.

    Definition Classes
    ErgoLikeContextInterpreterContext
    See also

    sigmastate.eval.Evaluation

  31. def toString(): String

    Permalink
    Definition Classes
    ErgoLikeContext → AnyRef → Any
  32. val validationSettings: SigmaValidationSettings

    Permalink

    validation parameters passed to Interpreter.verify to detect soft-fork conditions

    validation parameters passed to Interpreter.verify to detect soft-fork conditions

    Definition Classes
    ErgoLikeContextInterpreterContext
  33. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def withBindings(bindings: VarBinding*): InterpreterContext

    Permalink

    Creates a new instance with given bindings added to extension.

    Creates a new instance with given bindings added to extension.

    Definition Classes
    InterpreterContext
  37. def withCostLimit(newCostLimit: Long): ErgoLikeContext

    Permalink

    Creates a new instance with costLimit updated with given value.

    Creates a new instance with costLimit updated with given value.

    Definition Classes
    ErgoLikeContextInterpreterContext
  38. def withErgoTreeVersion(newVersion: Byte): ErgoLikeContext

    Permalink

    Creates a new instance with currErgoTreeVersion updated with the given value.

    Creates a new instance with currErgoTreeVersion updated with the given value.

    Definition Classes
    ErgoLikeContextInterpreterContext
  39. def withExtension(newExtension: ContextExtension): ErgoLikeContext

    Permalink

    Creates a new instance with extension updated with given value.

    Creates a new instance with extension updated with given value.

    Definition Classes
    ErgoLikeContextInterpreterContext
  40. def withInitCost(newInitCost: Long): ErgoLikeContext

    Permalink

    Creates a new instance with initCost updated with given value.

    Creates a new instance with initCost updated with given value.

    Definition Classes
    ErgoLikeContextInterpreterContext
  41. def withTransaction(newSpendingTransaction: ErgoLikeTransactionTemplate[_ <: UnsignedInput]): ErgoLikeContext

    Permalink
  42. def withValidationSettings(newVs: SigmaValidationSettings): ErgoLikeContext

    Permalink

    Creates a new instance with given validation settings.

    Creates a new instance with given validation settings.

    Definition Classes
    ErgoLikeContextInterpreterContext

Inherited from InterpreterContext

Inherited from AnyRef

Inherited from Any

Ungrouped