Skip to content
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

Bump Serialization Version in 1.2 to v5 #1708

Merged
merged 4 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to

## [Unreleased]

- cosmwasm-vm: Bumped module serialization version from v4 to v5 to invalidate
potentially corrupted caches caused by Rust update. See
https://github.com/CosmWasm/wasmvm/issues/426 for more information. ([#1708])

[#1708]: https://github.com/CosmWasm/cosmwasm/pull/1708

## [1.2.5] - 2023-05-02

### Added
Expand Down
8 changes: 6 additions & 2 deletions packages/vm/src/modules/file_system_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ use crate::modules::current_wasmer_module_version;
/// the module header version (<https://github.com/wasmerio/wasmer/issues/3193>). In cosmwasm-vm 1.1.0-1.1.1
/// the old value "v3" is still used along with Wasmer 2.3.0 (bug). From cosmwasm 1.1.2 onwards, this is
/// fixed by bumping to "v4".
const MODULE_SERIALIZATION_VERSION: &str = "v4";
/// - **v5**:<br>
/// A change in memory layout of some types in Rust [std] caused
/// [issues with module deserialization](https://github.com/CosmWasm/wasmvm/issues/426).
/// To work around this, the version was bumped to "v5" here to invalidate these corrupt caches.
const MODULE_SERIALIZATION_VERSION: &str = "v5";

/// Representation of a directory that contains compiled Wasm artifacts.
pub struct FileSystemCache {
Expand Down Expand Up @@ -236,7 +240,7 @@ mod tests {
cache.store(&checksum, &module).unwrap();

let file_path = format!(
"{}/v4-wasmer1/{}",
"{}/v5-wasmer1/{}",
tmp_dir.path().to_string_lossy(),
checksum
);
Expand Down