The first version of ErgoTree starting from which the JIT costing interpreter must be used.
The first version of ErgoTree starting from which the JIT costing interpreter must be used. It must also be used for all subsequent versions (3, 4, etc).
Maximum version of ErgoTree supported by this interpreter release.
Maximum version of ErgoTree supported by this interpreter release.
See version bits in ErgoTree.header
for more details.
This value should be increased with each new protocol update via soft-fork.
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.
Checks the version context has the given versions
Returns the current VersionContext attached to the current thread.
Returns the current VersionContext attached to the current thread.
Each thread can have only one current version context at any time, which can be
changed using withVersions
method.
withVersions()
Executes the given block under the given version context attached to the current thread.
Executes the given block under the given version context attached to the current thread.
The typical usage is to use VersionContext.withVersions(activatedVersion,
treeVersion) {...}
when the block of code needs to be executed with the given
versions.
For example, sigmastate.Interpreter uses it to execute operations according to the necessary versions of Ergo protocol and ErgoTree.
Currently activated script version == Block.headerVersion - 1
ErgoTree version to be set on the current thread
block of code to execute
result of block execution