-
Notifications
You must be signed in to change notification settings - Fork 61
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
Cosmwasm plus compatibility #19
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is cool to run the optimizer once on the entire repo instead multiple runs. I don't like that this exposes the shell scripts that are used on the public interface (but see why needed).
having an a glob argument that exponds on the host but then needs guest paths is confusing at least. Isn't there a cargo wasm
thing that works like cargo fmt
on the entire workspace by defaut?
Anyways, I need sleep, peace
Interesting point Simon. I tried It doesn't even require any arguments there. I will update and talk tomorrow. |
Yes, but what about non-workspace contracts? Good night. |
The other issue I see with this (and any multi-target build system in general) is how source code verification can work. If we don't get verification, we don't need rust-optimizer, so those go hand in hand. The following conventions would not be followed with the current approach:
https://github.com/CosmWasm/cosmwasm-verify#the-builder The reason for those is that we need to be able to verify without project specific meta information: https://github.com/CosmWasm/cosmwasm-verify/blob/master/src/main.sh#L67-L73 This then leads us to the question what the source code archive of a cosmwasm-plus contract contains. |
Okay, this doesn't work for cosmwasm contracts right now either. But let's revisit it. How about we change it to the following (this is a 0.9 -> 0.10 so we can break stuff):
With this, the verification steps are:
If this is not desired to change, then I can change the multi-optimizer.sh to have the same output as optimizer does (but then it takes a subpath.... not according to spec either). In either case, I should do some workspace-detection tricks, so we don't need arguments in the validator |
Right, this is why I call them "development contracts" whenever I can to express those must not be taken seriously. There is no concept for source publication for them either. |
The proposed rules are good. Some additional comments:
|
Okay, I would agree with these changes. I would try to make mono-repo and single-contract run in the same builder. (and say we don't support cosmwasm builds except with additional arguments, but violating the verifier approach). This means, I can make a default CMD that only supports I think I can unify these use cases as long as I will make all scripts return a set in |
Yes, perfect. Whatever we do in the cosmwasm repo is for VM maintainers only (relative paths to vm and std) and should never be deployed to any serious chain. |
Okay @webmaster128 please check out the latest commit (or just check the README usage). I tested this manually on All have the same behavior of placing named wasm files inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. This is a really great solution that improves functionality in a very clean fashion.
# create hash | ||
( | ||
cd artifacts | ||
sha256sum -- *.wasm > contracts.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this --
needed for something? Looks confusing to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shellcheck requested it.
If I had a file --some-bad-thing.wasm
it would be interpreted as a flag to sha256sum
not a file.
Not going to happen, but I just wanted shellcheck to let me run it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right it is, thanks for checking
🙏 holy shellcheck
Closes #18
Required for CosmWasm/cw-plus#29
This adds a second script that handles the
cosmwasm-plus
case nicely, while leaving theoptimize.sh
script untouched.The one issue that changes in the external API is that we cannot use entrypoint anymore. The default (no argument) compile works as is, but the
cosmwasm
compile process now requiresoptimize.sh ./contracts/hackatom
at the end.Updated the README to explain these cases.