Skip to content

Commit

Permalink
merging w. 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kushti committed Aug 2, 2024
2 parents 271ec30 + 01a424e commit eb219dd
Show file tree
Hide file tree
Showing 6 changed files with 4,299 additions and 783 deletions.
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/sigma/VersionContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case class VersionContext(activatedVersion: Byte, ergoTreeVersion: Byte) {
def isJitActivated: Boolean = activatedVersion >= JitActivationVersion

/** @return true, if the activated script version of Ergo protocol on the network is
* including Evolution update. */
* including v6.0 update. */
def isV6SoftForkActivated: Boolean = activatedVersion >= V6SoftForkVersion
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ trait Interpreter {
val currCost = addCostChecked(context.initCost, deserializeSubstitutionCost, context.costLimit)
val context1 = context.withInitCost(currCost).asInstanceOf[CTX]
val (propTree, context2) = trySoftForkable[(SigmaPropValue, CTX)](whenSoftFork = (TrueSigmaProp, context1)) {
applyDeserializeContextJITC(context, prop)
// Before ErgoTree V3 the deserialization cost was not added to the total cost
applyDeserializeContextJITC(if (VersionContext.current.activatedVersion >= VersionContext.V6SoftForkVersion) {
context1
} else {
context
}, prop)
}

// here we assume that when `propTree` is TrueProp then `reduceToCrypto` always succeeds
Expand Down Expand Up @@ -593,4 +598,4 @@ object Interpreter {
case x => throw new Error(s"Context-dependent pre-processing should produce tree of type Boolean or SigmaProp but was $x")
}

}
}
Loading

0 comments on commit eb219dd

Please sign in to comment.