Skip to content

Commit

Permalink
Merge pull request #1708 from CosmWasm/chipshort/bump-serialization-v…
Browse files Browse the repository at this point in the history
…ersion

Bump Serialization Version in 1.2 to v5
  • Loading branch information
webmaster128 authored Jun 5, 2023
2 parents 4318c67 + 9008479 commit 2f9a663
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit 2f9a663

Please sign in to comment.