-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
handle compilation of contracts properly (v4.x.x -> v5.x.x) #1189
Comments
Can we use the latest compiler by default after Iris and dry-run the contract calls before they get broadcasted? In case this fails - we switch to a failover compiler with lower pragma? |
I guess we could strive for a middle ground:
|
so that would mean that the SDK needs to handle that properly based on parsing the pragma and the dev needs to be able to pass URL for at least all major releases from v4.0.0 - v6.0.0 of the compiler, right? IMO we should have fixed URLs for the hosted compiler version then instead of requiring to pass the respective version in the header. what's your take on that @davidyuk? |
This stuff doesn't seem to be heavily related to sdk. HTTP compiler can automatically set a proper backend according to pragma and maybe some heuristic on source code (like if pragma is not defined and contract uses String.length without importing String.aes). |
I agree with that. I don't thin we should use some heuristic though. |
I second that. so for choosing the right backend we need https://github.com/aeternity/aesophia_http to handle that stuff based on the provided pragmas, right? or did you mean another solution? I just want to be sure that we have the same understanding. and if no pragma is set the http compiler will use the latest backend version by default. |
yes |
|
Firstly, this doesn't seem to be a big problem now (until we have a new compiler with breaking changes🙂). Also, we are not using a compiler for contract calls now (calldata lib instead), so future breaking changes would affect only contract deployments. I'm proposing to close his issue with an agreement to deploy compilers on different domains per version (like 6.compiler.aepps.com) to don't break existing apps that depend on compiler.aepps.com/latest.compiler.aepps.com in case of new compiler version |
@thepiwo raised the issue that people using the hosted compiler (which will be updated to v5.x.x) will have problems if their contracts rely on certain Sophia functionalities which faced breaking changes. for example accessing
String.length
requires stdlibinclude 'String.aes'
since v5.x.xproblems we see for actual users/developers:
@compiler =< 4.3
the compiler will raise an expected error that the contract is incompatible with v5.x.x and we know that the contract must be compiled with a compiler v4.x.xwe definitely need instructions for users how to deal with it.
ideally the SDK
as @thepiwo mentioned different versions of the hosted compiler can be used by specifying the version in the header:
curl https://compiler.aeternity.io/version -H 'Sophia-Compiler-Version: 5.0.0'
The text was updated successfully, but these errors were encountered: