diff --git a/CHANGELOG.md b/CHANGELOG.md index ca5026d74e..6994d6eacf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,11 +114,15 @@ and this project adheres to - cosmwasm-derive: Add support for migrate method with `migrate_info: MigrateInfo` argument. ([#2212]) - cosmwasm-vm: Add `Cache::store_code` +- cosmwasm-vm: Deprecate `PayPacketFee`, `PayPacketFeeAsync`, `IbcFee`. IBC fees + have been removed from ibc-go in version 10. The mentioned struct and enum + fields are deprecated and will be removed in cosmwasm `3.0` ([#2431]) [#2118]: https://github.com/CosmWasm/cosmwasm/pull/2118 [#2196]: https://github.com/CosmWasm/cosmwasm/pull/2196 [#2220]: https://github.com/CosmWasm/cosmwasm/pull/2220 [#2212]: https://github.com/CosmWasm/cosmwasm/pull/2212 +[#2431]: https://github.com/CosmWasm/cosmwasm/pull/2431 ### Changed diff --git a/contracts/ibc-reflect/schema/ibc/packet_msg.json b/contracts/ibc-reflect/schema/ibc/packet_msg.json index eec0371bd4..437bb46ac6 100644 --- a/contracts/ibc-reflect/schema/ibc/packet_msg.json +++ b/contracts/ibc-reflect/schema/ibc/packet_msg.json @@ -416,6 +416,7 @@ "additionalProperties": false }, "IbcFee": { + "deprecated": true, "type": "object", "required": [ "ack_fee", @@ -598,6 +599,7 @@ }, { "description": "Incentivizes the next IBC packet sent after this message with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled.\n\n# Example\n\nMost commonly, you will attach this message to a response right before sending a packet using [`IbcMsg::SendPacket`] or [`IbcMsg::Transfer`].\n\n```rust # use cosmwasm_std::{IbcMsg, IbcEndpoint, IbcFee, IbcTimeout, Coin, coins, CosmosMsg, Response, Timestamp};\n\nlet incentivize = IbcMsg::PayPacketFee { port_id: \"transfer\".to_string(), channel_id: \"source-channel\".to_string(), fee: IbcFee { receive_fee: coins(100, \"token\"), ack_fee: coins(201, \"token\"), timeout_fee: coins(200, \"token\"), }, relayers: vec![], }; let transfer = IbcMsg::Transfer { channel_id: \"source-channel\".to_string(), to_address: \"receiver\".to_string(), amount: Coin::new(100u32, \"token\"), timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(0)), memo: None, };\n\n# #[cfg(feature = \"stargate\")] let _: Response = Response::new() .add_message(CosmosMsg::Ibc(incentivize)) .add_message(CosmosMsg::Ibc(transfer)); ```", + "deprecated": true, "type": "object", "required": [ "pay_packet_fee" @@ -638,6 +640,7 @@ }, { "description": "Incentivizes the existing IBC packet with the given port, channel and sequence with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled. They are added to the existing fees on the packet.", + "deprecated": true, "type": "object", "required": [ "pay_packet_fee_async" diff --git a/contracts/reflect/schema/raw/execute.json b/contracts/reflect/schema/raw/execute.json index 60689b4e44..869f13e077 100644 --- a/contracts/reflect/schema/raw/execute.json +++ b/contracts/reflect/schema/raw/execute.json @@ -489,6 +489,7 @@ "additionalProperties": false }, "IbcFee": { + "deprecated": true, "type": "object", "required": [ "ack_fee", @@ -671,6 +672,7 @@ }, { "description": "Incentivizes the next IBC packet sent after this message with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled.\n\n# Example\n\nMost commonly, you will attach this message to a response right before sending a packet using [`IbcMsg::SendPacket`] or [`IbcMsg::Transfer`].\n\n```rust # use cosmwasm_std::{IbcMsg, IbcEndpoint, IbcFee, IbcTimeout, Coin, coins, CosmosMsg, Response, Timestamp};\n\nlet incentivize = IbcMsg::PayPacketFee { port_id: \"transfer\".to_string(), channel_id: \"source-channel\".to_string(), fee: IbcFee { receive_fee: coins(100, \"token\"), ack_fee: coins(201, \"token\"), timeout_fee: coins(200, \"token\"), }, relayers: vec![], }; let transfer = IbcMsg::Transfer { channel_id: \"source-channel\".to_string(), to_address: \"receiver\".to_string(), amount: Coin::new(100u32, \"token\"), timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(0)), memo: None, };\n\n# #[cfg(feature = \"stargate\")] let _: Response = Response::new() .add_message(CosmosMsg::Ibc(incentivize)) .add_message(CosmosMsg::Ibc(transfer)); ```", + "deprecated": true, "type": "object", "required": [ "pay_packet_fee" @@ -711,6 +713,7 @@ }, { "description": "Incentivizes the existing IBC packet with the given port, channel and sequence with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled. They are added to the existing fees on the packet.", + "deprecated": true, "type": "object", "required": [ "pay_packet_fee_async" diff --git a/contracts/reflect/schema/reflect.json b/contracts/reflect/schema/reflect.json index 9a4c0e5364..1a3e3fdd02 100644 --- a/contracts/reflect/schema/reflect.json +++ b/contracts/reflect/schema/reflect.json @@ -499,6 +499,7 @@ "additionalProperties": false }, "IbcFee": { + "deprecated": true, "type": "object", "required": [ "ack_fee", @@ -681,6 +682,7 @@ }, { "description": "Incentivizes the next IBC packet sent after this message with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled.\n\n# Example\n\nMost commonly, you will attach this message to a response right before sending a packet using [`IbcMsg::SendPacket`] or [`IbcMsg::Transfer`].\n\n```rust # use cosmwasm_std::{IbcMsg, IbcEndpoint, IbcFee, IbcTimeout, Coin, coins, CosmosMsg, Response, Timestamp};\n\nlet incentivize = IbcMsg::PayPacketFee { port_id: \"transfer\".to_string(), channel_id: \"source-channel\".to_string(), fee: IbcFee { receive_fee: coins(100, \"token\"), ack_fee: coins(201, \"token\"), timeout_fee: coins(200, \"token\"), }, relayers: vec![], }; let transfer = IbcMsg::Transfer { channel_id: \"source-channel\".to_string(), to_address: \"receiver\".to_string(), amount: Coin::new(100u32, \"token\"), timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(0)), memo: None, };\n\n# #[cfg(feature = \"stargate\")] let _: Response = Response::new() .add_message(CosmosMsg::Ibc(incentivize)) .add_message(CosmosMsg::Ibc(transfer)); ```", + "deprecated": true, "type": "object", "required": [ "pay_packet_fee" @@ -721,6 +723,7 @@ }, { "description": "Incentivizes the existing IBC packet with the given port, channel and sequence with a fee. Note that this does not necessarily have to be a packet sent by this contract. The fees are taken from the contract's balance immediately and locked until the packet is handled. They are added to the existing fees on the packet.", + "deprecated": true, "type": "object", "required": [ "pay_packet_fee_async" diff --git a/packages/std/src/ibc.rs b/packages/std/src/ibc.rs index 58505db626..310f5dc420 100644 --- a/packages/std/src/ibc.rs +++ b/packages/std/src/ibc.rs @@ -1,3 +1,5 @@ +#![allow(deprecated)] + // The CosmosMsg variants are defined in results/cosmos_msg.rs // The rest of the IBC related functionality is defined here @@ -111,6 +113,10 @@ pub enum IbcMsg { /// .add_message(CosmosMsg::Ibc(transfer)); /// ``` #[cfg(feature = "cosmwasm_2_2")] + #[deprecated( + since = "2.2.3", + note = "IBC fees have been removed from ibc-go `v10`, which is used in wasmd `v0.55.0`." + )] PayPacketFee { /// The port id on the chain where the packet is sent from (this chain). port_id: String, @@ -128,6 +134,10 @@ pub enum IbcMsg { /// The fees are taken from the contract's balance immediately and locked until the packet is handled. /// They are added to the existing fees on the packet. #[cfg(feature = "cosmwasm_2_2")] + #[deprecated( + since = "2.2.3", + note = "IBC fees have been removed from ibc-go `v10`, which is used in wasmd `v0.55.0`." + )] PayPacketFeeAsync { /// The port id on the chain where the packet is sent from (this chain). port_id: String, @@ -144,6 +154,10 @@ pub enum IbcMsg { }, } +#[deprecated( + since = "2.2.3", + note = "IBC fees have been removed from ibc-go `v10`, which is used in wasmd `v0.55.0`." +)] #[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq, Eq, JsonSchema)] pub struct IbcFee { // the packet receive fee diff --git a/packages/std/src/lib.rs b/packages/std/src/lib.rs index 83794c1c8d..aa48f7588b 100644 --- a/packages/std/src/lib.rs +++ b/packages/std/src/lib.rs @@ -69,10 +69,12 @@ pub use crate::errors::{ }; pub use crate::hex_binary::HexBinary; pub use crate::ibc::IbcChannelOpenResponse; +#[allow(deprecated)] +pub use crate::ibc::IbcFee; pub use crate::ibc::{ Ibc3ChannelOpenResponse, IbcAckCallbackMsg, IbcAcknowledgement, IbcBasicResponse, IbcCallbackRequest, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg, - IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcFee, IbcMsg, IbcOrder, IbcPacket, + IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcMsg, IbcOrder, IbcPacket, IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse, IbcSourceCallbackMsg, IbcSrcCallback, IbcTimeout, IbcTimeoutBlock, IbcTimeoutCallbackMsg, TransferMsgBuilder,