From a4a6fbfc72454af32f77c7735e7e077b4d25083c Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 4 Jan 2023 23:13:42 +0100 Subject: [PATCH 1/4] Split payment and cleanup implementations --- contracts/burner/schema/burner.json | 1 + contracts/burner/schema/raw/migrate.json | 1 + contracts/burner/src/contract.rs | 124 ++++++++++++++++++----- contracts/burner/src/msg.rs | 13 +++ contracts/burner/tests/integration.rs | 82 +++++++++++---- 5 files changed, 177 insertions(+), 44 deletions(-) diff --git a/contracts/burner/schema/burner.json b/contracts/burner/schema/burner.json index 58e102e12e..9aa679c82d 100644 --- a/contracts/burner/schema/burner.json +++ b/contracts/burner/schema/burner.json @@ -20,6 +20,7 @@ ], "properties": { "payout": { + "description": "The address we send all remaining balance to", "type": "string" } }, diff --git a/contracts/burner/schema/raw/migrate.json b/contracts/burner/schema/raw/migrate.json index 231a265325..30b6f16527 100644 --- a/contracts/burner/schema/raw/migrate.json +++ b/contracts/burner/schema/raw/migrate.json @@ -7,6 +7,7 @@ ], "properties": { "payout": { + "description": "The address we send all remaining balance to", "type": "string" } }, diff --git a/contracts/burner/src/contract.rs b/contracts/burner/src/contract.rs index e486be5b18..e2cd85fb37 100644 --- a/contracts/burner/src/contract.rs +++ b/contracts/burner/src/contract.rs @@ -2,7 +2,7 @@ use cosmwasm_std::{ entry_point, BankMsg, DepsMut, Env, MessageInfo, Order, Response, StdError, StdResult, }; -use crate::msg::{InstantiateMsg, MigrateMsg}; +use crate::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg}; #[entry_point] pub fn instantiate( @@ -18,31 +18,58 @@ pub fn instantiate( #[entry_point] pub fn migrate(deps: DepsMut, env: Env, msg: MigrateMsg) -> StdResult { - // delete all state - let keys: Vec<_> = deps - .storage - .range(None, None, Order::Ascending) - .map(|(k, _)| k) - .collect(); - let count = keys.len(); - for k in keys { - deps.storage.remove(&k); - } - // get balance and send all to recipient let balance = deps.querier.query_all_balances(env.contract.address)?; let send = BankMsg::Send { to_address: msg.payout.clone(), amount: balance, }; + Ok(Response::new() + .add_message(send) + .add_attribute("action", "burn") + .add_attribute("payout", msg.payout)) +} + +#[entry_point] +pub fn execute(deps: DepsMut, env: Env, info: MessageInfo, msg: ExecuteMsg) -> StdResult { + match msg { + ExecuteMsg::Cleanup { limit } => execute_cleanup(deps, env, info, limit), + } +} + +pub fn execute_cleanup( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + limit: Option, +) -> StdResult { + // the number of elements we can still take (decreasing over time) + let mut limit = limit.unwrap_or(u32::MAX) as usize; - let data_msg = format!("burnt {} keys", count).into_bytes(); + let mut deleted = 0; + const PER_SCAN: usize = 20; + loop { + let take_this_scan = std::cmp::min(PER_SCAN, limit); + let keys: Vec<_> = deps + .storage + .range(None, None, Order::Ascending) + .take(take_this_scan) + .map(|(k, _)| k) + .collect(); + let deleted_this_scan = keys.len(); + for k in keys { + deps.storage.remove(&k); + } + deleted += deleted_this_scan; + limit -= deleted_this_scan; + if limit == 0 || deleted_this_scan < take_this_scan { + break; + } + } Ok(Response::new() - .add_message(send) .add_attribute("action", "burn") - .add_attribute("payout", msg.payout) - .set_data(data_msg)) + .add_attribute("deleted_entries", deleted.to_string())) } #[cfg(test)] @@ -51,7 +78,18 @@ mod tests { use cosmwasm_std::testing::{ mock_dependencies, mock_dependencies_with_balance, mock_env, mock_info, }; - use cosmwasm_std::{coins, StdError, Storage, SubMsg}; + use cosmwasm_std::{coins, Attribute, StdError, Storage, SubMsg}; + + /// Gets the value of the first attribute with the given key + fn first_attr(data: impl AsRef<[Attribute]>, search_key: &str) -> Option { + data.as_ref().iter().find_map(|a| { + if a.key == search_key { + Some(a.value.clone()) + } else { + None + } + }) + } #[test] fn instantiate_fails() { @@ -70,16 +108,9 @@ mod tests { } #[test] - fn migrate_cleans_up_data() { + fn migrate_sends_funds() { let mut deps = mock_dependencies_with_balance(&coins(123456, "gold")); - // store some sample data - deps.storage.set(b"foo", b"bar"); - deps.storage.set(b"key2", b"data2"); - deps.storage.set(b"key3", b"cool stuff"); - let cnt = deps.storage.range(None, None, Order::Ascending).count(); - assert_eq!(3, cnt); - // change the verifier via migrate let payout = String::from("someone else"); let msg = MigrateMsg { @@ -96,9 +127,48 @@ mod tests { amount: coins(123456, "gold"), }) ); + } + + #[test] + fn execute_cleans_up_data() { + let mut deps = mock_dependencies_with_balance(&coins(123456, "gold")); + + // store some sample data + deps.storage.set(b"foo", b"bar"); + deps.storage.set(b"key2", b"data2"); + deps.storage.set(b"key3", b"cool stuff"); + let cnt = deps.storage.range(None, None, Order::Ascending).count(); + assert_eq!(cnt, 3); + + // change the verifier via migrate + let payout = String::from("someone else"); + let msg = MigrateMsg { payout }; + let _res = migrate(deps.as_mut(), mock_env(), msg).unwrap(); + + let res = execute( + deps.as_mut(), + mock_env(), + mock_info("anon", &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "2"); + + // One item should be left + let cnt = deps.storage.range(None, None, Order::Ascending).count(); + assert_eq!(cnt, 1); + + let res = execute( + deps.as_mut(), + mock_env(), + mock_info("anon", &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "1"); - // check there is no data in storage + // Now all are gone let cnt = deps.storage.range(None, None, Order::Ascending).count(); - assert_eq!(0, cnt); + assert_eq!(cnt, 0); } } diff --git a/contracts/burner/src/msg.rs b/contracts/burner/src/msg.rs index f948004231..602223eccb 100644 --- a/contracts/burner/src/msg.rs +++ b/contracts/burner/src/msg.rs @@ -2,9 +2,22 @@ use cosmwasm_schema::cw_serde; #[cw_serde] pub struct MigrateMsg { + /// The address we send all remaining balance to pub payout: String, } /// A placeholder where we don't take any input #[cw_serde] pub struct InstantiateMsg {} + +#[cw_serde] +pub enum ExecuteMsg { + /// Cleans up the given number of state elements. + /// Call this multiple times to increamentally clean up state. + Cleanup { + /// The number of state elements to delete. + /// + /// Set this to None for unlimited cleanup (if your state is small or you are feeling YOLO) + limit: Option, + }, +} diff --git a/contracts/burner/tests/integration.rs b/contracts/burner/tests/integration.rs index 8f30c2cca7..fe6069d4c9 100644 --- a/contracts/burner/tests/integration.rs +++ b/contracts/burner/tests/integration.rs @@ -17,10 +17,10 @@ //! }); //! 4. Anywhere you see query(&deps, ...) you must replace it with query(&mut deps, ...) -use cosmwasm_std::{coins, BankMsg, ContractResult, Order, Response, SubMsg}; -use cosmwasm_vm::testing::{instantiate, migrate, mock_env, mock_info, mock_instance}; +use cosmwasm_std::{coins, Attribute, BankMsg, ContractResult, Order, Response, SubMsg}; +use cosmwasm_vm::testing::{execute, instantiate, migrate, mock_env, mock_info, mock_instance}; -use burner::msg::{InstantiateMsg, MigrateMsg}; +use burner::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg}; use cosmwasm_vm::Storage; // This line will test the output of cargo wasm @@ -28,6 +28,17 @@ static WASM: &[u8] = include_bytes!("../target/wasm32-unknown-unknown/release/bu // You can uncomment this line instead to test productionified build from rust-optimizer // static WASM: &[u8] = include_bytes!("../contract.wasm"); +/// Gets the value of the first attribute with the given key +fn first_attr(data: impl AsRef<[Attribute]>, search_key: &str) -> Option { + data.as_ref().iter().find_map(|a| { + if a.key == search_key { + Some(a.value.clone()) + } else { + None + } + }) +} + #[test] fn instantiate_fails() { let mut deps = mock_instance(WASM, &[]); @@ -44,21 +55,9 @@ fn instantiate_fails() { } #[test] -fn migrate_cleans_up_data() { +fn migrate_sends_funds() { let mut deps = mock_instance(WASM, &coins(123456, "gold")); - // store some sample data - deps.with_storage(|storage| { - storage.set(b"foo", b"bar").0.unwrap(); - storage.set(b"key2", b"data2").0.unwrap(); - storage.set(b"key3", b"cool stuff").0.unwrap(); - let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); - let cnt = storage.all(iter_id).0.unwrap().len(); - assert_eq!(3, cnt); - Ok(()) - }) - .unwrap(); - // change the verifier via migrate let payout = String::from("someone else"); let msg = MigrateMsg { @@ -75,12 +74,61 @@ fn migrate_cleans_up_data() { amount: coins(123456, "gold"), }), ); +} + +#[test] +fn execute_cleans_up_data() { + let mut deps = mock_instance(WASM, &coins(123456, "gold")); + + // store some sample data + deps.with_storage(|storage| { + storage.set(b"foo", b"bar").0.unwrap(); + storage.set(b"key2", b"data2").0.unwrap(); + storage.set(b"key3", b"cool stuff").0.unwrap(); + let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); + let cnt = storage.all(iter_id).0.unwrap().len(); + assert_eq!(cnt, 3); + Ok(()) + }) + .unwrap(); + + // change the verifier via migrate + let payout = String::from("someone else"); + let msg = MigrateMsg { payout }; + let _res: Response = migrate(&mut deps, mock_env(), msg).unwrap(); + + let res: Response = execute( + &mut deps, + mock_env(), + mock_info("anon", &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "2"); + + // One item should be left + deps.with_storage(|storage| { + let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); + let cnt = storage.all(iter_id).0.unwrap().len(); + assert_eq!(cnt, 1); + Ok(()) + }) + .unwrap(); + + let res: Response = execute( + &mut deps, + mock_env(), + mock_info("anon", &[]), + ExecuteMsg::Cleanup { limit: Some(2) }, + ) + .unwrap(); + assert_eq!(first_attr(res.attributes, "deleted_entries").unwrap(), "1"); // check there is no data in storage deps.with_storage(|storage| { let iter_id = storage.scan(None, None, Order::Ascending).0.unwrap(); let cnt = storage.all(iter_id).0.unwrap().len(); - assert_eq!(0, cnt); + assert_eq!(cnt, 0); Ok(()) }) .unwrap(); From 86313551f38e8ade85a06ef3617a0159f7d7f69c Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 4 Jan 2023 23:19:58 +0100 Subject: [PATCH 2/4] Remove license files at contract level --- contracts/burner/LICENSE | 202 --------------------------------------- contracts/burner/NOTICE | 13 --- 2 files changed, 215 deletions(-) delete mode 100644 contracts/burner/LICENSE delete mode 100644 contracts/burner/NOTICE diff --git a/contracts/burner/LICENSE b/contracts/burner/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/contracts/burner/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/contracts/burner/NOTICE b/contracts/burner/NOTICE deleted file mode 100644 index b8f34a8f13..0000000000 --- a/contracts/burner/NOTICE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright 2020 Ethan Frey - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. From 4ed470acd374f3c47dae19d205329875ce0e29ad Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Wed, 4 Jan 2023 23:20:32 +0100 Subject: [PATCH 3/4] Add me to authors --- contracts/burner/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/burner/Cargo.toml b/contracts/burner/Cargo.toml index 93a74b7efe..7484840261 100644 --- a/contracts/burner/Cargo.toml +++ b/contracts/burner/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "burner" version = "0.0.0" -authors = ["Ethan Frey "] +authors = ["Ethan Frey ", "Simon Warta "] edition = "2021" publish = false license = "Apache-2.0" From 7c3cf31c347e173cd3cabfb89641fe729f4f2495 Mon Sep 17 00:00:00 2001 From: Simon Warta Date: Thu, 5 Jan 2023 17:59:05 +0100 Subject: [PATCH 4/4] Bump to cosmwasm/rust-optimizer:0.12.11 --- .circleci/config.yml | 2 +- README.md | 2 +- contracts/README.md | 20 ++++++++++---------- packages/vm/README.md | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d299a74156..166f2be8be 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1036,7 +1036,7 @@ jobs: name: Build development contracts command: | echo "Building all contracts under ./contracts" - docker run --volumes-from with_code cosmwasm/rust-optimizer:0.12.9 ./contracts/*/ + docker run --volumes-from with_code cosmwasm/rust-optimizer:0.12.11 ./contracts/*/ - run: name: Check development contracts command: | diff --git a/README.md b/README.md index b71dab0b68..f2c06ae3b8 100644 --- a/README.md +++ b/README.md @@ -412,7 +412,7 @@ but the quickstart guide is: docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 + cosmwasm/rust-optimizer:0.12.11 ``` It will output a highly size-optimized build as `contract.wasm` in `$CODE`. With diff --git a/contracts/README.md b/contracts/README.md index 1f581ed2e0..f4b931d197 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -53,52 +53,52 @@ reason, use the following commands: docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_burner",target=/code/contracts/burner/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/burner + cosmwasm/rust-optimizer:0.12.11 ./contracts/burner docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_crypto_verify",target=/code/contracts/crypto-verify/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/crypto-verify + cosmwasm/rust-optimizer:0.12.11 ./contracts/crypto-verify docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_floaty",target=/code/contracts/floaty/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/floaty + cosmwasm/rust-optimizer:0.12.11 ./contracts/floaty docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_hackatom",target=/code/contracts/hackatom/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/hackatom + cosmwasm/rust-optimizer:0.12.11 ./contracts/hackatom docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_ibc_reflect",target=/code/contracts/ibc-reflect/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect + cosmwasm/rust-optimizer:0.12.11 ./contracts/ibc-reflect docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_ibc_reflect_send",target=/code/contracts/ibc-reflect-send/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect-send + cosmwasm/rust-optimizer:0.12.11 ./contracts/ibc-reflect-send docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_queue",target=/code/contracts/queue/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/queue + cosmwasm/rust-optimizer:0.12.11 ./contracts/queue docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_reflect",target=/code/contracts/reflect/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/reflect + cosmwasm/rust-optimizer:0.12.11 ./contracts/reflect docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_staking",target=/code/contracts/staking/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/staking + cosmwasm/rust-optimizer:0.12.11 ./contracts/staking docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_virus",target=/code/contracts/virus/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/virus + cosmwasm/rust-optimizer:0.12.11 ./contracts/virus ``` ## Entry points diff --git a/packages/vm/README.md b/packages/vm/README.md index 2d85697bed..26baa85caa 100644 --- a/packages/vm/README.md +++ b/packages/vm/README.md @@ -53,25 +53,25 @@ To rebuild the test contracts, go to the repo root and do docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_cyberpunk",target=/code/contracts/cyberpunk/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.10 ./contracts/cyberpunk \ + cosmwasm/rust-optimizer:0.12.11 ./contracts/cyberpunk \ && cp artifacts/cyberpunk.wasm packages/vm/testdata/cyberpunk.wasm docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_hackatom",target=/code/contracts/hackatom/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/hackatom \ + cosmwasm/rust-optimizer:0.12.11 ./contracts/hackatom \ && cp artifacts/hackatom.wasm packages/vm/testdata/hackatom_1.0.wasm docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_ibc_reflect",target=/code/contracts/ibc-reflect/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/ibc-reflect \ + cosmwasm/rust-optimizer:0.12.11 ./contracts/ibc-reflect \ && cp artifacts/ibc_reflect.wasm packages/vm/testdata/ibc_reflect_1.0.wasm docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="devcontract_cache_floaty",target=/code/contracts/floaty/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.9 ./contracts/floaty \ + cosmwasm/rust-optimizer:0.12.11 ./contracts/floaty \ && cp artifacts/floaty.wasm packages/vm/testdata/floaty_1.0.wasm ```