Skip to content

Commit 10242fd

Browse files
authored
Merge pull request #2431 from CosmWasm/tkulik/chore/deprecate_ibc_fees
chore: Deprecate IBC fees
2 parents 3f0b433 + 14f8097 commit 10242fd

File tree

6 files changed

+30
-1
lines changed

6 files changed

+30
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,15 @@ and this project adheres to
5959
- cosmwasm-derive: Add support for migrate method with
6060
`migrate_info: MigrateInfo` argument. ([#2212])
6161
- cosmwasm-vm: Add `Cache::store_code`
62+
- cosmwasm-vm: Deprecate `PayPacketFee`, `PayPacketFeeAsync`, `IbcFee`. IBC fees
63+
have been removed from ibc-go in version 10. The mentioned struct and enum
64+
fields are deprecated and will be removed in cosmwasm `3.0` ([#2431])
6265

6366
[#2118]: https://github.com/CosmWasm/cosmwasm/pull/2118
6467
[#2196]: https://github.com/CosmWasm/cosmwasm/pull/2196
6568
[#2220]: https://github.com/CosmWasm/cosmwasm/pull/2220
6669
[#2212]: https://github.com/CosmWasm/cosmwasm/pull/2212
70+
[#2431]: https://github.com/CosmWasm/cosmwasm/pull/2431
6771

6872
### Changed
6973

contracts/ibc-reflect/schema/ibc/packet_msg.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@
416416
"additionalProperties": false
417417
},
418418
"IbcFee": {
419+
"deprecated": true,
419420
"type": "object",
420421
"required": [
421422
"ack_fee",
@@ -598,6 +599,7 @@
598599
},
599600
{
600601
"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)); ```",
602+
"deprecated": true,
601603
"type": "object",
602604
"required": [
603605
"pay_packet_fee"
@@ -638,6 +640,7 @@
638640
},
639641
{
640642
"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.",
643+
"deprecated": true,
641644
"type": "object",
642645
"required": [
643646
"pay_packet_fee_async"

contracts/reflect/schema/raw/execute.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@
489489
"additionalProperties": false
490490
},
491491
"IbcFee": {
492+
"deprecated": true,
492493
"type": "object",
493494
"required": [
494495
"ack_fee",
@@ -671,6 +672,7 @@
671672
},
672673
{
673674
"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)); ```",
675+
"deprecated": true,
674676
"type": "object",
675677
"required": [
676678
"pay_packet_fee"
@@ -711,6 +713,7 @@
711713
},
712714
{
713715
"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.",
716+
"deprecated": true,
714717
"type": "object",
715718
"required": [
716719
"pay_packet_fee_async"

contracts/reflect/schema/reflect.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@
499499
"additionalProperties": false
500500
},
501501
"IbcFee": {
502+
"deprecated": true,
502503
"type": "object",
503504
"required": [
504505
"ack_fee",
@@ -681,6 +682,7 @@
681682
},
682683
{
683684
"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)); ```",
685+
"deprecated": true,
684686
"type": "object",
685687
"required": [
686688
"pay_packet_fee"
@@ -721,6 +723,7 @@
721723
},
722724
{
723725
"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.",
726+
"deprecated": true,
724727
"type": "object",
725728
"required": [
726729
"pay_packet_fee_async"

packages/std/src/ibc.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(deprecated)]
2+
13
// The CosmosMsg variants are defined in results/cosmos_msg.rs
24
// The rest of the IBC related functionality is defined here
35

@@ -111,6 +113,10 @@ pub enum IbcMsg {
111113
/// .add_message(CosmosMsg::Ibc(transfer));
112114
/// ```
113115
#[cfg(feature = "cosmwasm_2_2")]
116+
#[deprecated(
117+
since = "2.2.3",
118+
note = "IBC fees have been removed from ibc-go `v10`, which is used in wasmd `v0.55.0`."
119+
)]
114120
PayPacketFee {
115121
/// The port id on the chain where the packet is sent from (this chain).
116122
port_id: String,
@@ -128,6 +134,10 @@ pub enum IbcMsg {
128134
/// The fees are taken from the contract's balance immediately and locked until the packet is handled.
129135
/// They are added to the existing fees on the packet.
130136
#[cfg(feature = "cosmwasm_2_2")]
137+
#[deprecated(
138+
since = "2.2.3",
139+
note = "IBC fees have been removed from ibc-go `v10`, which is used in wasmd `v0.55.0`."
140+
)]
131141
PayPacketFeeAsync {
132142
/// The port id on the chain where the packet is sent from (this chain).
133143
port_id: String,
@@ -144,6 +154,10 @@ pub enum IbcMsg {
144154
},
145155
}
146156

157+
#[deprecated(
158+
since = "2.2.3",
159+
note = "IBC fees have been removed from ibc-go `v10`, which is used in wasmd `v0.55.0`."
160+
)]
147161
#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq, Eq, JsonSchema)]
148162
pub struct IbcFee {
149163
// the packet receive fee

packages/std/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,12 @@ pub use crate::errors::{
6767
};
6868
pub use crate::hex_binary::HexBinary;
6969
pub use crate::ibc::IbcChannelOpenResponse;
70+
#[allow(deprecated)]
71+
pub use crate::ibc::IbcFee;
7072
pub use crate::ibc::{
7173
Ibc3ChannelOpenResponse, IbcAckCallbackMsg, IbcAcknowledgement, IbcBasicResponse,
7274
IbcCallbackRequest, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg,
73-
IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcFee, IbcMsg, IbcOrder, IbcPacket,
75+
IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcMsg, IbcOrder, IbcPacket,
7476
IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse,
7577
IbcSourceCallbackMsg, IbcSrcCallback, IbcTimeout, IbcTimeoutBlock, IbcTimeoutCallbackMsg,
7678
TransferMsgBuilder,

0 commit comments

Comments
 (0)