Skip to content

[planning] Hard-fork Activation Support  #660

@aslesarenko

Description

@aslesarenko

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:

  1. support both the old ErgoTree v0 and the new ErgoTree v1 and
  2. 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.

Metadata

Metadata

Assignees

Labels

40hApproximately 40 hours or work (1 week)A-consensusArea: Code used in consensus (i.e. transaction validation)C-planningCategory: Planning and roadmaps

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions