Skip to content

chore: Deprecate IBC fees (backport #2431) #2434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions contracts/ibc-reflect/schema/ibc/packet_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@
"additionalProperties": false
},
"IbcFee": {
"deprecated": true,
"type": "object",
"required": [
"ack_fee",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions contracts/reflect/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@
"additionalProperties": false
},
"IbcFee": {
"deprecated": true,
"type": "object",
"required": [
"ack_fee",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions contracts/reflect/schema/reflect.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@
"additionalProperties": false
},
"IbcFee": {
"deprecated": true,
"type": "object",
"required": [
"ack_fee",
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
14 changes: 14 additions & 0 deletions packages/std/src/ibc.rs
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion packages/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading