Skip to content

Feature: Versioning #248

@Sdoba16

Description

@Sdoba16

Project

compiler

Describe the feature

Current version of Simplicity is

  1. Not backward compatible
  2. Each user could produce different hex-string depending on the crate versions, hardware or etc.
    Since that we need to add versioning to simplicity, which will help to keep determinism and keep ability not to rewrite each smart-contract whether the compiler changes.

The proposed versioning solution is to keep Solidity's pragma version usage. So we would write pragma version X.Y.Z; at the top of the file, and it will lock the compilation to those rules.

Implementation plan:

  1. Update the lexer and parser to read the pragma at the start of the file.
  2. Read the compiler's actual version from Cargo.toml at build time.
  3. Show version errors if there is a mismatch (for example, if a user tries to use new functions in an old version, or old functions in a new one).
  4. Create a tool that reads the pragma and automatically downloads and executes the correct compiler binary for the requested version.
  5. To handle cases where a user tries to use a newer feature on an older compiler, update error messages to include a helpful hint to check their pragma and compiler version. (Reads an error message after compiler work, so that each binary is deterministic)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions