diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7f866f6751..cccf3c20ea 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,6 +37,13 @@ and this project adheres to
[#1807]: https://github.com/CosmWasm/cosmwasm/pull/1807
[#1864]: https://github.com/CosmWasm/cosmwasm/pull/1864
+### Changed
+
+- cosmwasm-vm: Added `.module` extension to file names in the file system cache
+ ([#1913]).
+
+[#1913]: https://github.com/CosmWasm/cosmwasm/pull/1913
+
## [1.4.1] - 2023-10-09
## Fixed
diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs
index b634007087..60d8ddaf56 100644
--- a/packages/vm/src/modules/file_system_cache.rs
+++ b/packages/vm/src/modules/file_system_cache.rs
@@ -49,7 +49,10 @@ use crate::modules::current_wasmer_module_version;
/// - **v7**:
/// New version because of Wasmer 2.3.0 -> 4 upgrade.
/// This internally changes how rkyv is used for module serialization, making compatibility unlikely.
-const MODULE_SERIALIZATION_VERSION: &str = "v7";
+/// - **v8**:
+/// New version because of Wasmer 4.1.2 -> 4.2.2 upgrade.
+/// Module compatibility between Wasmer versions is not guaranteed.
+const MODULE_SERIALIZATION_VERSION: &str = "v8";
/// Representation of a directory that contains compiled Wasm artifacts.
pub struct FileSystemCache {
@@ -118,6 +121,14 @@ impl FileSystemCache {
self.unchecked_modules = unchecked;
}
+ /// Returns the path to the serialized module with the given checksum.
+ fn module_file(&self, checksum: &Checksum) -> PathBuf {
+ let mut path = self.modules_path.clone();
+ path.push(checksum.to_hex());
+ path.set_extension("module");
+ path
+ }
+
/// Loads a serialized module from the file system and returns a module (i.e. artifact + store),
/// along with the size of the serialized module.
pub fn load(
@@ -125,8 +136,7 @@ impl FileSystemCache {
checksum: &Checksum,
engine: &impl AsEngineRef,
) -> VmResult