-
Notifications
You must be signed in to change notification settings - Fork 824
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
Serialized module stability #2781
Comments
|
Thank you for the quick response and update. This solves a large part of the problem: random crashes are converted into load time errors. Now for the context of blockchain, it would be very unfortunate if we had to recompile all the program for every Wasmer bump. Especially when the caller of Wasmer is a library, not an application we can have users thet upgrade Wasmer without us knowing. Would it be possible as an addition to #2747 to export the version as a compile time constant? This would allow me to do something like this: // TODO: convert to compile time error once available in Rust
assert_eq!(MetadataHeader::CURRENT_VERSION, 1, "Wasmer module format changed. Please update the expected version accordingly and bump MODULE_SERIALIZATION_VERSION."); |
In https://github.com/CosmWasm/cosmwasm/blob/7c1519c82e024a8860f01b4a7eb3dfe9295d1371/packages/vm/src/modules/versioning.rs#L14-L39 I implemented a workaround for the missing API that I'm very happy with. It's a bit complicated to compile an emty module to read the version number from the module serialization, but it does the job. At the same time it shows which API we'd need to create one directory per module version, such that re-compiles only need to be done when the version actually changed. |
This is tracked in #2916. |
Summary
In one of our use case we compile and serialize modules with Wasmer 2.0.0 and derialize and run it with Wasmer 2.1.1. This leads to crashes at runtime. As soon as the cache is cleared between the two versions, everything works smoothly.
I digged a bit in the code and have two questions:
SerializableModule
changed?Additional details
The text was updated successfully, but these errors were encountered: