v5.0 activation
One potential complication we probably need to deal with and think about. Interpretation of ErgoTree must depend on the version number stored in ErgoTree.header. Regardless of the current blockVersion, the semantics (and hence interpretation) of a contract is defined by ErgoTree.version. We currently have ErgoTrees with versions 0 (v3.x releases) and 1 (v4.x) in their headers. After v5.0 is activated, version 2 will also be allowed. Thus, after v5.0 activation we will have blocks with increased version, but most of the transactions will spend boxes with 0 and 1 in ErgoTree.header.
With this in mind the current condition
if (context.activatedScriptVersion > Interpreter.MaxSupportedScriptVersion) which triggers SPV mode is over-conservative.
In principle it can be replaced with
if (context.currentErgoTreeVersion > Interpreter.MaxSupportedScriptVersion), which means that even after activation, old nodes can still verify spending of all the boxes created before activation (i.e. most of them).7 Replies
kushti — Today at 4:13 PM
in 6.0 ? yes, for 5.0 all the versions would be the same for the interpreter as only costing changed.
Do you want to propose something for 6.0 or what ?
@kushti I added context.currentErgoTreeVersion property, which is taken from the ErgoTree passed to fullReduction. It can be used in new v5.0 interpreter now to fix some bugs, already in v5.0 (like XorOf, seftBoxIndex, and others) if we want to do so.
I see, do we want to do that though? let's discuss over the GH
ok, i created this pr https://github.com/ScorexFoundation/sigmastate-interpreter/pull/748 on top of the tests, which are all needed
GitHub
Activation of v5.0 by aslesarenko · Pull Request #748 · ScorexFound...
… - introduced context.currentErgoTreeVersion
can discuss there
in the PR ? issues are more suitable though
also I suppose that better to move intended changes in semantics to a next SF, as it would be good to understand unintended ones happened after 5.0
ok
will we replace
if (context.activatedScriptVersion > Interpreter.MaxSupportedScriptVersion) with more accurate if (context.currentErgoTreeVersion > Interpreter.MaxSupportedScriptVersion)
?to prepare for upcoming 6.0 ? likely yes