-
Notifications
You must be signed in to change notification settings - Fork 33
Feature: Versioning #248
Copy link
Copy link
Open
Description
Project
compiler
Describe the feature
Current version of Simplicity is
- Not backward compatible
- 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:
- Update the lexer and parser to read the pragma at the start of the file.
- Read the compiler's actual version from
Cargo.tomlat build time. - 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).
- Create a tool that reads the pragma and automatically downloads and executes the correct compiler binary for the requested version.
- 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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels