From 3eb94fbff82c59bd2ccf040e279108a411f2c79a Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Mon, 5 Jun 2023 15:03:21 +0200 Subject: [PATCH 1/4] Bump module serialization version --- packages/vm/src/modules/file_system_cache.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs index 95b1a3e288..6fcdbc1af4 100644 --- a/packages/vm/src/modules/file_system_cache.rs +++ b/packages/vm/src/modules/file_system_cache.rs @@ -39,7 +39,11 @@ use crate::modules::current_wasmer_module_version; /// the module header version (). 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**:
+/// 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 { From 0f909291ede7d82926c0bb24199ad623c0a06e51 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Mon, 5 Jun 2023 15:08:11 +0200 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14215138d7..833c135b3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to ## [Unreleased] +- cosmwasm-vm: Bumped serialization version number to invalidate corrupt caches + caused by Rust update ([#1708]) + +[#1708]: https://github.com/CosmWasm/cosmwasm/pull/1708 + ## [1.2.5] - 2023-05-02 ### Added From 539909673901c423572eab9c904a27f903a618f8 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Mon, 5 Jun 2023 15:15:11 +0200 Subject: [PATCH 3/4] Fix test --- packages/vm/src/modules/file_system_cache.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs index 6fcdbc1af4..e5041a9900 100644 --- a/packages/vm/src/modules/file_system_cache.rs +++ b/packages/vm/src/modules/file_system_cache.rs @@ -240,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 ); From 90084792ba2ea199fcc30ccab4793e2ffbffe201 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Mon, 5 Jun 2023 15:38:10 +0200 Subject: [PATCH 4/4] Improve CHANGELOG text --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 833c135b3e..ddf9998211 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,9 @@ and this project adheres to ## [Unreleased] -- cosmwasm-vm: Bumped serialization version number to invalidate corrupt caches - caused by Rust update ([#1708]) +- 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