-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Problem
The hard-fork activation will be implemented according to EIP-9.
To support activation protocol, sigma code should support both ErgoTree v0 and v1 versions at the same time (even in the same transaction). This means we cannot accumulate changes in a separate branch (as we normally do) and then release them all at once (which would replace v0 version with v1 version implementation).
Support of both versions simultaneously requires a discipline in how the protocol related changes are introduced into the code.
Solution
Roughly, the idea is that the code changes should be protected by version checking conditions like the following:
if (currVersion == v1) {
// new code
} else if (currVersion == v0) {
// old code
} else {
// unsupported version
}This will makes the code:
- support both the old ErgoTree v0 and the new ErgoTree v1 and
- switch the version conditionally based on the value of currVersion.
Existing v4.0 branch has already accumulated many protocol related changes, however those are without version checking conditions.