From c1313afeb261e17b1c8cf6a1eacee1da0dac42ae Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Mon, 5 Aug 2024 12:40:36 +0200 Subject: [PATCH 1/8] Change gas --- contracts/hackatom/tests/integration.rs | 4 ++-- packages/vm/src/instance.rs | 8 ++++---- packages/vm/src/wasm_backend/engine.rs | 17 +++++++++++++++-- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/contracts/hackatom/tests/integration.rs b/contracts/hackatom/tests/integration.rs index 1b82fdb7b8..ef192d7366 100644 --- a/contracts/hackatom/tests/integration.rs +++ b/contracts/hackatom/tests/integration.rs @@ -412,7 +412,7 @@ fn execute_allocate_large_memory() { // Gas consumption is relatively small // Note: the exact gas usage depends on the Rust version used to compile Wasm, // which we only fix when using rust-optimizer, not integration tests. - assert_approx_eq!(gas_used, 4413600, "0.2"); + assert_approx_eq!(gas_used, 9470400, "0.2"); let used = deps.memory_pages(); assert_eq!(used, pages_before + 48, "Memory used: {used} pages"); pages_before += 48; @@ -431,7 +431,7 @@ fn execute_allocate_large_memory() { // Gas consumption is relatively small // Note: the exact gas usage depends on the Rust version used to compile Wasm, // which we only fix when using rust-optimizer, not integration tests. - let expected = 4859700; // +/- 20% + let expected = 9553320; // +/- 20% assert!(gas_used > expected * 80 / 100, "Gas used: {gas_used}"); assert!(gas_used < expected * 120 / 100, "Gas used: {gas_used}"); let used = deps.memory_pages(); diff --git a/packages/vm/src/instance.rs b/packages/vm/src/instance.rs index d3166d7a5d..7a52013b58 100644 --- a/packages/vm/src/instance.rs +++ b/packages/vm/src/instance.rs @@ -914,7 +914,7 @@ mod tests { let report2 = instance.create_gas_report(); assert_eq!(report2.used_externally, 251); - assert_eq!(report2.used_internally, 11473730); + assert_eq!(report2.used_internally, 16995280); assert_eq!(report2.limit, LIMIT); assert_eq!( report2.remaining, @@ -1105,7 +1105,7 @@ mod tests { .unwrap(); let init_used = orig_gas - instance.get_gas_left(); - assert_eq!(init_used, 11473981); + assert_eq!(init_used, 16995531); } #[test] @@ -1130,7 +1130,7 @@ mod tests { .unwrap(); let execute_used = gas_before_execute - instance.get_gas_left(); - assert_eq!(execute_used, 12086566); + assert_eq!(execute_used, 19589666); } #[test] @@ -1173,6 +1173,6 @@ mod tests { ); let query_used = gas_before_query - instance.get_gas_left(); - assert_eq!(query_used, 7570446); + assert_eq!(query_used, 11942871); } } diff --git a/packages/vm/src/wasm_backend/engine.rs b/packages/vm/src/wasm_backend/engine.rs index 7b2f6190a9..a6bdb62e09 100644 --- a/packages/vm/src/wasm_backend/engine.rs +++ b/packages/vm/src/wasm_backend/engine.rs @@ -16,14 +16,27 @@ use super::limiting_tunables::LimitingTunables; /// https://github.com/WebAssembly/memory64/blob/master/proposals/memory64/Overview.md const MAX_WASM_PAGES: u32 = 65536; -fn cost(_operator: &Operator) -> u64 { +fn cost(operator: &Operator) -> u64 { // A flat fee for each operation // The target is 1 Teragas per second (see GAS.md). // // In https://github.com/CosmWasm/cosmwasm/pull/1042 a profiler is developed to // identify runtime differences between different Wasm operation, but this is not yet // precise enough to derive insights from it. - 170 + const GAS_PER_OPERATION: u64 = 115; + + match operator { + Operator::Loop { .. } + | Operator::End + | Operator::Else + | Operator::Br { .. } + | Operator::BrTable { .. } + | Operator::BrIf { .. } + | Operator::Call { .. } + | Operator::CallIndirect { .. } + | Operator::Return => GAS_PER_OPERATION * 14, + _ => GAS_PER_OPERATION, + } } /// Use Cranelift as the compiler backend if the feature is enabled From a4f318fc882d803b534241fb225260389895edd3 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 8 Aug 2024 10:39:23 +0200 Subject: [PATCH 2/8] Add changelog entry --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5db4c5c60..8f2bdab974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ and this project adheres to ## [Unreleased] +### Fixed + +- cosmwasm-vm: Fix CWA-2024-004 + ## [2.1.1] - 2024-07-30 ### Fixed From 101ca1f01dad18fbc46d5440a242db1ef968838c Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 8 Aug 2024 11:05:28 +0200 Subject: [PATCH 3/8] chore: Release --- CHANGELOG.md | 5 ++++- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- contracts/burner/Cargo.lock | 14 +++++++------- contracts/crypto-verify/Cargo.lock | 14 +++++++------- contracts/cyberpunk/Cargo.lock | 14 +++++++------- contracts/empty/Cargo.lock | 14 +++++++------- contracts/floaty/Cargo.lock | 14 +++++++------- contracts/hackatom/Cargo.lock | 14 +++++++------- contracts/ibc-callbacks/Cargo.lock | 14 +++++++------- contracts/ibc-reflect-send/Cargo.lock | 14 +++++++------- contracts/ibc-reflect/Cargo.lock | 14 +++++++------- contracts/queue/Cargo.lock | 14 +++++++------- contracts/reflect/Cargo.lock | 14 +++++++------- contracts/staking/Cargo.lock | 14 +++++++------- contracts/virus/Cargo.lock | 14 +++++++------- packages/check/Cargo.toml | 4 ++-- packages/crypto/Cargo.toml | 2 +- packages/derive/Cargo.toml | 2 +- packages/go-gen/Cargo.toml | 4 ++-- packages/schema/Cargo.toml | 2 +- packages/std/Cargo.toml | 10 +++++----- packages/vm/Cargo.toml | 6 +++--- 23 files changed, 119 insertions(+), 116 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f2bdab974..d54b2ffacb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to ## [Unreleased] +## [2.1.2] - 2024-08-08 + ### Fixed - cosmwasm-vm: Fix CWA-2024-004 @@ -888,7 +890,8 @@ The CHANGELOG for versions before 1.0.0 was moved to -[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.1...HEAD +[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.2...HEAD +[2.1.2]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.1...v2.1.2 [2.1.1]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.1...v2.1.0 [2.0.1]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.0...v2.0.1 diff --git a/Cargo.lock b/Cargo.lock index 6221f7c468..85b656d183 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -549,7 +549,7 @@ dependencies = [ [[package]] name = "cosmwasm-check" -version = "2.1.1" +version = "2.1.2" dependencies = [ "anyhow", "assert_cmd", @@ -562,11 +562,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -597,7 +597,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-std", "proc-macro2", @@ -607,7 +607,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "anyhow", "cosmwasm-schema-derive", @@ -621,7 +621,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -630,7 +630,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.1", "bech32", @@ -656,7 +656,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 7a6277c24b..7639e24207 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ exclude = ["contracts"] resolver = "2" [workspace.package] -version = "2.1.1" +version = "2.1.2" [workspace.dependencies] schemars = "0.8.4" diff --git a/contracts/burner/Cargo.lock b/contracts/burner/Cargo.lock index 5e71f66de9..64ac7a10de 100644 --- a/contracts/burner/Cargo.lock +++ b/contracts/burner/Cargo.lock @@ -353,11 +353,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -378,7 +378,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -407,7 +407,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -428,7 +428,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/crypto-verify/Cargo.lock b/contracts/crypto-verify/Cargo.lock index 4ae9b2a201..5333cd011c 100644 --- a/contracts/crypto-verify/Cargo.lock +++ b/contracts/crypto-verify/Cargo.lock @@ -348,11 +348,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -373,7 +373,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -393,7 +393,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -423,7 +423,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/cyberpunk/Cargo.lock b/contracts/cyberpunk/Cargo.lock index d5196dfa40..2fe6fb71d0 100644 --- a/contracts/cyberpunk/Cargo.lock +++ b/contracts/cyberpunk/Cargo.lock @@ -365,11 +365,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -390,7 +390,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -410,7 +410,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -419,7 +419,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -440,7 +440,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/empty/Cargo.lock b/contracts/empty/Cargo.lock index b10977567f..fd09ce66d9 100644 --- a/contracts/empty/Cargo.lock +++ b/contracts/empty/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/floaty/Cargo.lock b/contracts/floaty/Cargo.lock index acd1aebf78..574ce92746 100644 --- a/contracts/floaty/Cargo.lock +++ b/contracts/floaty/Cargo.lock @@ -354,11 +354,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.1", "bech32", @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/hackatom/Cargo.lock b/contracts/hackatom/Cargo.lock index 20e0519717..7402ad997c 100644 --- a/contracts/hackatom/Cargo.lock +++ b/contracts/hackatom/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/ibc-callbacks/Cargo.lock b/contracts/ibc-callbacks/Cargo.lock index c5d4915f65..5358de47bf 100644 --- a/contracts/ibc-callbacks/Cargo.lock +++ b/contracts/ibc-callbacks/Cargo.lock @@ -354,11 +354,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.1", "bech32", @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/ibc-reflect-send/Cargo.lock b/contracts/ibc-reflect-send/Cargo.lock index e65ed244eb..7fc009cbab 100644 --- a/contracts/ibc-reflect-send/Cargo.lock +++ b/contracts/ibc-reflect-send/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/ibc-reflect/Cargo.lock b/contracts/ibc-reflect/Cargo.lock index f138ec09b2..496fb36daf 100644 --- a/contracts/ibc-reflect/Cargo.lock +++ b/contracts/ibc-reflect/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/queue/Cargo.lock b/contracts/queue/Cargo.lock index 025d324b63..dfbf1bc45e 100644 --- a/contracts/queue/Cargo.lock +++ b/contracts/queue/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/reflect/Cargo.lock b/contracts/reflect/Cargo.lock index b855aac52b..fa697be30e 100644 --- a/contracts/reflect/Cargo.lock +++ b/contracts/reflect/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/staking/Cargo.lock b/contracts/staking/Cargo.lock index e6331e006b..ba916b1204 100644 --- a/contracts/staking/Cargo.lock +++ b/contracts/staking/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/contracts/virus/Cargo.lock b/contracts/virus/Cargo.lock index a19f5247da..8c58fd5824 100644 --- a/contracts/virus/Cargo.lock +++ b/contracts/virus/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.1" +version = "2.1.2" [[package]] name = "cosmwasm-crypto" -version = "2.1.1" +version = "2.1.2" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.1" +version = "2.1.2" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.1" +version = "2.1.2" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.1" +version = "2.1.2" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.1" +version = "2.1.2" dependencies = [ "bech32", "bytes", diff --git a/packages/check/Cargo.toml b/packages/check/Cargo.toml index 21730e7290..8b06b7b4ce 100644 --- a/packages/check/Cargo.toml +++ b/packages/check/Cargo.toml @@ -11,8 +11,8 @@ license = "Apache-2.0" anyhow = "1.0.57" clap = "4" colored = "2.1.0" -cosmwasm-vm = { path = "../vm", version = "=2.1.1" } -cosmwasm-std = { path = "../std", version = "=2.1.1" } +cosmwasm-vm = { path = "../vm", version = "=2.1.2" } +cosmwasm-std = { path = "../std", version = "=2.1.2" } [dev-dependencies] assert_cmd = "2.0.12" diff --git a/packages/crypto/Cargo.toml b/packages/crypto/Cargo.toml index fdd71778ca..97afa21f6c 100644 --- a/packages/crypto/Cargo.toml +++ b/packages/crypto/Cargo.toml @@ -16,7 +16,7 @@ ark-bls12-381 = "0.4.0" ark-ec = { version = "0.4.2", features = ["parallel"] } ark-ff = { version = "0.4.2", features = ["asm", "parallel"] } ark-serialize = "0.4.2" -cosmwasm-core = { version = "2.1.1", path = "../core" } +cosmwasm-core = { version = "2.1.2", path = "../core" } digest = "0.10" ecdsa = "0.16.2" # Not used directly, but needed to bump transitive dependency, see: https://github.com/CosmWasm/cosmwasm/pull/1899 for details. ed25519-zebra = { version = "4.0.3", default-features = false } diff --git a/packages/derive/Cargo.toml b/packages/derive/Cargo.toml index e39e9903d7..3a04fab30f 100644 --- a/packages/derive/Cargo.toml +++ b/packages/derive/Cargo.toml @@ -24,4 +24,4 @@ syn = { version = "2", features = ["full"] } # "What's even more fun, Cargo packages actually can have cyclic dependencies. # "(a package can have an indirect dev-dependency on itself)" # https://users.rust-lang.org/t/does-cargo-support-cyclic-dependencies/35666/3 -cosmwasm-std = { version = "2.1.1", path = "../std" } +cosmwasm-std = { version = "2.1.2", path = "../std" } diff --git a/packages/go-gen/Cargo.toml b/packages/go-gen/Cargo.toml index 7c7d6747d6..e5340df4c1 100644 --- a/packages/go-gen/Cargo.toml +++ b/packages/go-gen/Cargo.toml @@ -9,12 +9,12 @@ publish = false release = false [dependencies] -cosmwasm-std = { version = "2.1.1", path = "../std", features = [ +cosmwasm-std = { version = "2.1.2", path = "../std", features = [ "cosmwasm_2_1", "staking", "stargate", ] } -cosmwasm-schema = { version = "2.1.1", path = "../schema" } +cosmwasm-schema = { version = "2.1.2", path = "../schema" } anyhow = "1" Inflector = "0.11.4" indenter = "0.3.3" diff --git a/packages/schema/Cargo.toml b/packages/schema/Cargo.toml index 3a0b79e9e6..3f91db6f8c 100644 --- a/packages/schema/Cargo.toml +++ b/packages/schema/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema" license = "Apache-2.0" [dependencies] -cosmwasm-schema-derive = { version = "=2.1.1", path = "../schema-derive" } +cosmwasm-schema-derive = { version = "=2.1.2", path = "../schema-derive" } schemars = { workspace = true } serde = { workspace = true } serde_json = "1.0.40" diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 4b276c218b..7dd7cea13b 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -52,8 +52,8 @@ cosmwasm_2_1 = ["cosmwasm_2_0"] [dependencies] base64 = "0.22.0" bnum = "0.11.0" -cosmwasm-core = { version = "2.1.1", path = "../core" } -cosmwasm-derive = { version = "2.1.1", path = "../derive" } +cosmwasm-core = { version = "2.1.2", path = "../core" } +cosmwasm-derive = { version = "2.1.2", path = "../derive" } derive_more = { version = "1.0.0-beta.6", default-features = false, features = ["debug"] } hex = "0.4" schemars = { workspace = true } @@ -65,12 +65,12 @@ thiserror = "1.0.26" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] bech32 = "0.11.0" -cosmwasm-crypto = { version = "2.1.1", path = "../crypto" } +cosmwasm-crypto = { version = "2.1.2", path = "../crypto" } rand_core = { version = "0.6.4", features = ["getrandom"] } [dev-dependencies] -cosmwasm-core = { path = "../core", version = "2.1.1" } -cosmwasm-schema = { version = "2.1.1", path = "../schema" } +cosmwasm-core = { path = "../core", version = "2.1.2" } +cosmwasm-schema = { version = "2.1.2", path = "../schema" } # The chrono dependency is only used in an example, which Rust compiles for us. If this causes trouble, remove it. chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] } crc32fast = "1.3.2" diff --git a/packages/vm/Cargo.toml b/packages/vm/Cargo.toml index 2ee5019036..89c0b231cf 100644 --- a/packages/vm/Cargo.toml +++ b/packages/vm/Cargo.toml @@ -45,9 +45,9 @@ clru = "0.6.1" crc32fast = "1.3.2" bech32 = "0.11.0" # Uses the path when built locally; uses the given version from crates.io when published -cosmwasm-core = { version = "2.1.1", path = "../core" } -cosmwasm-std = { version = "2.1.1", path = "../std", default-features = false, features = ["std"] } -cosmwasm-crypto = { version = "2.1.1", path = "../crypto" } +cosmwasm-core = { version = "2.1.2", path = "../core" } +cosmwasm-std = { version = "2.1.2", path = "../std", default-features = false, features = ["std"] } +cosmwasm-crypto = { version = "2.1.2", path = "../crypto" } derivative = "2" hex = "0.4" rand_core = { version = "0.6", features = ["getrandom"] } From e03585e6b8a5c1eb0fb89583865569b6901b6860 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 8 Aug 2024 17:41:39 +0200 Subject: [PATCH 4/8] Bump module serialization version --- packages/vm/src/modules/file_system_cache.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs index 185b18fe58..6c9cdf8478 100644 --- a/packages/vm/src/modules/file_system_cache.rs +++ b/packages/vm/src/modules/file_system_cache.rs @@ -61,7 +61,9 @@ use super::CachedModule; /// - **v9**:
/// New version because of Wasmer 4.2.2 -> 4.2.6 upgrade. /// Module compatibility between Wasmer versions is not guaranteed. -const MODULE_SERIALIZATION_VERSION: &str = "v9"; +/// - **v10**:
+/// New version because of Metering middleware change. +const MODULE_SERIALIZATION_VERSION: &str = "v10"; /// Representation of a directory that contains compiled Wasm artifacts. pub struct FileSystemCache { From 1a369f829d00dd82a4807063362b367ecdc981ae Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 8 Aug 2024 18:03:51 +0200 Subject: [PATCH 5/8] Fix module version in tests --- packages/vm/src/modules/file_system_cache.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vm/src/modules/file_system_cache.rs b/packages/vm/src/modules/file_system_cache.rs index 6c9cdf8478..f0c240f19a 100644 --- a/packages/vm/src/modules/file_system_cache.rs +++ b/packages/vm/src/modules/file_system_cache.rs @@ -315,7 +315,7 @@ mod tests { cache.store(&checksum, &module).unwrap(); let mut globber = glob::glob(&format!( - "{}/v9-wasmer7/**/{}.module", + "{}/v10-wasmer7/**/{}.module", tmp_dir.path().to_string_lossy(), checksum )) @@ -398,9 +398,9 @@ mod tests { assert_eq!( p.as_os_str(), if cfg!(windows) { - "modules\\v9-wasmer17\\x86_64-nintendo-fuchsia-gnu-coff-01E9F9FE" + "modules\\v10-wasmer17\\x86_64-nintendo-fuchsia-gnu-coff-01E9F9FE" } else { - "modules/v9-wasmer17/x86_64-nintendo-fuchsia-gnu-coff-01E9F9FE" + "modules/v10-wasmer17/x86_64-nintendo-fuchsia-gnu-coff-01E9F9FE" } ); } From b3e61d48f9bd320563842e72de60df9d4726e10b Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 8 Aug 2024 18:17:05 +0200 Subject: [PATCH 6/8] Add changelog entry --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d54b2ffacb..0070804c7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ and this project adheres to ## [Unreleased] +### Fixed + +- cosmwasm-vm: Problem with caching related to CWA-2024-004. Please upgrade + directly to this version instead of the previous one. + ## [2.1.2] - 2024-08-08 ### Fixed From 6f61673273315029992a54817942c620dab0447a Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Thu, 8 Aug 2024 18:20:49 +0200 Subject: [PATCH 7/8] chore: Release --- CHANGELOG.md | 5 ++++- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- contracts/burner/Cargo.lock | 14 +++++++------- contracts/crypto-verify/Cargo.lock | 14 +++++++------- contracts/cyberpunk/Cargo.lock | 14 +++++++------- contracts/empty/Cargo.lock | 14 +++++++------- contracts/floaty/Cargo.lock | 14 +++++++------- contracts/hackatom/Cargo.lock | 14 +++++++------- contracts/ibc-callbacks/Cargo.lock | 14 +++++++------- contracts/ibc-reflect-send/Cargo.lock | 14 +++++++------- contracts/ibc-reflect/Cargo.lock | 14 +++++++------- contracts/queue/Cargo.lock | 14 +++++++------- contracts/reflect/Cargo.lock | 14 +++++++------- contracts/staking/Cargo.lock | 14 +++++++------- contracts/virus/Cargo.lock | 14 +++++++------- packages/check/Cargo.toml | 4 ++-- packages/crypto/Cargo.toml | 2 +- packages/derive/Cargo.toml | 2 +- packages/go-gen/Cargo.toml | 4 ++-- packages/schema/Cargo.toml | 2 +- packages/std/Cargo.toml | 10 +++++----- packages/vm/Cargo.toml | 6 +++--- 23 files changed, 119 insertions(+), 116 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0070804c7b..c0678c80c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to ## [Unreleased] +## [2.1.3] - 2024-08-08 + ### Fixed - cosmwasm-vm: Problem with caching related to CWA-2024-004. Please upgrade @@ -895,7 +897,8 @@ The CHANGELOG for versions before 1.0.0 was moved to -[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.2...HEAD +[unreleased]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.3...HEAD +[2.1.3]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.2...v2.1.3 [2.1.2]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.1...v2.1.2 [2.1.1]: https://github.com/CosmWasm/cosmwasm/compare/v2.1.0...v2.1.1 [2.1.0]: https://github.com/CosmWasm/cosmwasm/compare/v2.0.1...v2.1.0 diff --git a/Cargo.lock b/Cargo.lock index 85b656d183..0aa633b9c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -549,7 +549,7 @@ dependencies = [ [[package]] name = "cosmwasm-check" -version = "2.1.2" +version = "2.1.3" dependencies = [ "anyhow", "assert_cmd", @@ -562,11 +562,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -597,7 +597,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-std", "proc-macro2", @@ -607,7 +607,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "anyhow", "cosmwasm-schema-derive", @@ -621,7 +621,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -630,7 +630,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.1", "bech32", @@ -656,7 +656,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 7639e24207..b94f48ad28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ exclude = ["contracts"] resolver = "2" [workspace.package] -version = "2.1.2" +version = "2.1.3" [workspace.dependencies] schemars = "0.8.4" diff --git a/contracts/burner/Cargo.lock b/contracts/burner/Cargo.lock index 64ac7a10de..f67e8bebb5 100644 --- a/contracts/burner/Cargo.lock +++ b/contracts/burner/Cargo.lock @@ -353,11 +353,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -378,7 +378,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -398,7 +398,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -407,7 +407,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -428,7 +428,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/crypto-verify/Cargo.lock b/contracts/crypto-verify/Cargo.lock index 5333cd011c..50c7e4d348 100644 --- a/contracts/crypto-verify/Cargo.lock +++ b/contracts/crypto-verify/Cargo.lock @@ -348,11 +348,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -373,7 +373,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -393,7 +393,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -423,7 +423,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/cyberpunk/Cargo.lock b/contracts/cyberpunk/Cargo.lock index 2fe6fb71d0..a79e93d697 100644 --- a/contracts/cyberpunk/Cargo.lock +++ b/contracts/cyberpunk/Cargo.lock @@ -365,11 +365,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -390,7 +390,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -410,7 +410,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -419,7 +419,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -440,7 +440,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/empty/Cargo.lock b/contracts/empty/Cargo.lock index fd09ce66d9..5c95b66cee 100644 --- a/contracts/empty/Cargo.lock +++ b/contracts/empty/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/floaty/Cargo.lock b/contracts/floaty/Cargo.lock index 574ce92746..497437c686 100644 --- a/contracts/floaty/Cargo.lock +++ b/contracts/floaty/Cargo.lock @@ -354,11 +354,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.1", "bech32", @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/hackatom/Cargo.lock b/contracts/hackatom/Cargo.lock index 7402ad997c..f3860cdd4c 100644 --- a/contracts/hackatom/Cargo.lock +++ b/contracts/hackatom/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/ibc-callbacks/Cargo.lock b/contracts/ibc-callbacks/Cargo.lock index 5358de47bf..7b61420bea 100644 --- a/contracts/ibc-callbacks/Cargo.lock +++ b/contracts/ibc-callbacks/Cargo.lock @@ -354,11 +354,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -379,7 +379,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -408,7 +408,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.1", "bech32", @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/ibc-reflect-send/Cargo.lock b/contracts/ibc-reflect-send/Cargo.lock index 7fc009cbab..45da080a9d 100644 --- a/contracts/ibc-reflect-send/Cargo.lock +++ b/contracts/ibc-reflect-send/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/ibc-reflect/Cargo.lock b/contracts/ibc-reflect/Cargo.lock index 496fb36daf..bd7ff40bae 100644 --- a/contracts/ibc-reflect/Cargo.lock +++ b/contracts/ibc-reflect/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/queue/Cargo.lock b/contracts/queue/Cargo.lock index dfbf1bc45e..7c80c06e8b 100644 --- a/contracts/queue/Cargo.lock +++ b/contracts/queue/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/reflect/Cargo.lock b/contracts/reflect/Cargo.lock index fa697be30e..c6233732be 100644 --- a/contracts/reflect/Cargo.lock +++ b/contracts/reflect/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/staking/Cargo.lock b/contracts/staking/Cargo.lock index ba916b1204..e8fe84c3f6 100644 --- a/contracts/staking/Cargo.lock +++ b/contracts/staking/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/contracts/virus/Cargo.lock b/contracts/virus/Cargo.lock index 8c58fd5824..8f8497dc37 100644 --- a/contracts/virus/Cargo.lock +++ b/contracts/virus/Cargo.lock @@ -342,11 +342,11 @@ dependencies = [ [[package]] name = "cosmwasm-core" -version = "2.1.2" +version = "2.1.3" [[package]] name = "cosmwasm-crypto" -version = "2.1.2" +version = "2.1.3" dependencies = [ "ark-bls12-381", "ark-ec", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "2.1.2" +version = "2.1.3" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -387,7 +387,7 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "2.1.2" +version = "2.1.3" dependencies = [ "proc-macro2", "quote", @@ -396,7 +396,7 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "2.1.2" +version = "2.1.3" dependencies = [ "base64 0.22.0", "bech32", @@ -417,7 +417,7 @@ dependencies = [ [[package]] name = "cosmwasm-vm" -version = "2.1.2" +version = "2.1.3" dependencies = [ "bech32", "bytes", diff --git a/packages/check/Cargo.toml b/packages/check/Cargo.toml index 8b06b7b4ce..2ebf07fe3b 100644 --- a/packages/check/Cargo.toml +++ b/packages/check/Cargo.toml @@ -11,8 +11,8 @@ license = "Apache-2.0" anyhow = "1.0.57" clap = "4" colored = "2.1.0" -cosmwasm-vm = { path = "../vm", version = "=2.1.2" } -cosmwasm-std = { path = "../std", version = "=2.1.2" } +cosmwasm-vm = { path = "../vm", version = "=2.1.3" } +cosmwasm-std = { path = "../std", version = "=2.1.3" } [dev-dependencies] assert_cmd = "2.0.12" diff --git a/packages/crypto/Cargo.toml b/packages/crypto/Cargo.toml index 97afa21f6c..355e42add3 100644 --- a/packages/crypto/Cargo.toml +++ b/packages/crypto/Cargo.toml @@ -16,7 +16,7 @@ ark-bls12-381 = "0.4.0" ark-ec = { version = "0.4.2", features = ["parallel"] } ark-ff = { version = "0.4.2", features = ["asm", "parallel"] } ark-serialize = "0.4.2" -cosmwasm-core = { version = "2.1.2", path = "../core" } +cosmwasm-core = { version = "2.1.3", path = "../core" } digest = "0.10" ecdsa = "0.16.2" # Not used directly, but needed to bump transitive dependency, see: https://github.com/CosmWasm/cosmwasm/pull/1899 for details. ed25519-zebra = { version = "4.0.3", default-features = false } diff --git a/packages/derive/Cargo.toml b/packages/derive/Cargo.toml index 3a04fab30f..5ae90044a3 100644 --- a/packages/derive/Cargo.toml +++ b/packages/derive/Cargo.toml @@ -24,4 +24,4 @@ syn = { version = "2", features = ["full"] } # "What's even more fun, Cargo packages actually can have cyclic dependencies. # "(a package can have an indirect dev-dependency on itself)" # https://users.rust-lang.org/t/does-cargo-support-cyclic-dependencies/35666/3 -cosmwasm-std = { version = "2.1.2", path = "../std" } +cosmwasm-std = { version = "2.1.3", path = "../std" } diff --git a/packages/go-gen/Cargo.toml b/packages/go-gen/Cargo.toml index e5340df4c1..710f68b69f 100644 --- a/packages/go-gen/Cargo.toml +++ b/packages/go-gen/Cargo.toml @@ -9,12 +9,12 @@ publish = false release = false [dependencies] -cosmwasm-std = { version = "2.1.2", path = "../std", features = [ +cosmwasm-std = { version = "2.1.3", path = "../std", features = [ "cosmwasm_2_1", "staking", "stargate", ] } -cosmwasm-schema = { version = "2.1.2", path = "../schema" } +cosmwasm-schema = { version = "2.1.3", path = "../schema" } anyhow = "1" Inflector = "0.11.4" indenter = "0.3.3" diff --git a/packages/schema/Cargo.toml b/packages/schema/Cargo.toml index 3f91db6f8c..c3dec849f4 100644 --- a/packages/schema/Cargo.toml +++ b/packages/schema/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/CosmWasm/cosmwasm/tree/main/packages/schema" license = "Apache-2.0" [dependencies] -cosmwasm-schema-derive = { version = "=2.1.2", path = "../schema-derive" } +cosmwasm-schema-derive = { version = "=2.1.3", path = "../schema-derive" } schemars = { workspace = true } serde = { workspace = true } serde_json = "1.0.40" diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 7dd7cea13b..46eda4ab71 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -52,8 +52,8 @@ cosmwasm_2_1 = ["cosmwasm_2_0"] [dependencies] base64 = "0.22.0" bnum = "0.11.0" -cosmwasm-core = { version = "2.1.2", path = "../core" } -cosmwasm-derive = { version = "2.1.2", path = "../derive" } +cosmwasm-core = { version = "2.1.3", path = "../core" } +cosmwasm-derive = { version = "2.1.3", path = "../derive" } derive_more = { version = "1.0.0-beta.6", default-features = false, features = ["debug"] } hex = "0.4" schemars = { workspace = true } @@ -65,12 +65,12 @@ thiserror = "1.0.26" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] bech32 = "0.11.0" -cosmwasm-crypto = { version = "2.1.2", path = "../crypto" } +cosmwasm-crypto = { version = "2.1.3", path = "../crypto" } rand_core = { version = "0.6.4", features = ["getrandom"] } [dev-dependencies] -cosmwasm-core = { path = "../core", version = "2.1.2" } -cosmwasm-schema = { version = "2.1.2", path = "../schema" } +cosmwasm-core = { path = "../core", version = "2.1.3" } +cosmwasm-schema = { version = "2.1.3", path = "../schema" } # The chrono dependency is only used in an example, which Rust compiles for us. If this causes trouble, remove it. chrono = { version = "0.4", default-features = false, features = ["alloc", "std"] } crc32fast = "1.3.2" diff --git a/packages/vm/Cargo.toml b/packages/vm/Cargo.toml index 89c0b231cf..acfdc1dfaa 100644 --- a/packages/vm/Cargo.toml +++ b/packages/vm/Cargo.toml @@ -45,9 +45,9 @@ clru = "0.6.1" crc32fast = "1.3.2" bech32 = "0.11.0" # Uses the path when built locally; uses the given version from crates.io when published -cosmwasm-core = { version = "2.1.2", path = "../core" } -cosmwasm-std = { version = "2.1.2", path = "../std", default-features = false, features = ["std"] } -cosmwasm-crypto = { version = "2.1.2", path = "../crypto" } +cosmwasm-core = { version = "2.1.3", path = "../core" } +cosmwasm-std = { version = "2.1.3", path = "../std", default-features = false, features = ["std"] } +cosmwasm-crypto = { version = "2.1.3", path = "../crypto" } derivative = "2" hex = "0.4" rand_core = { version = "0.6", features = ["getrandom"] } From df673aa72e1eea9b3dfe1996bc0f78083d6db697 Mon Sep 17 00:00:00 2001 From: Christoph Otter Date: Fri, 9 Aug 2024 11:26:54 +0200 Subject: [PATCH 8/8] Add note about module serialization version to cost function --- packages/vm/src/wasm_backend/engine.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vm/src/wasm_backend/engine.rs b/packages/vm/src/wasm_backend/engine.rs index a6bdb62e09..49bc803c2f 100644 --- a/packages/vm/src/wasm_backend/engine.rs +++ b/packages/vm/src/wasm_backend/engine.rs @@ -23,6 +23,10 @@ fn cost(operator: &Operator) -> u64 { // In https://github.com/CosmWasm/cosmwasm/pull/1042 a profiler is developed to // identify runtime differences between different Wasm operation, but this is not yet // precise enough to derive insights from it. + // + // Please note that any changes to this function need to be accompanied by a bump of + // `MODULE_SERIALIZATION_VERSION` to avoid cached modules from using different amounts of gas + // compared to newly compiled ones. const GAS_PER_OPERATION: u64 = 115; match operator {