Skip to content

Commit e7a635d

Browse files
committed
chore: Remove IBC fees
1 parent 8b05ab2 commit e7a635d

File tree

7 files changed

+8
-139
lines changed

7 files changed

+8
-139
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ and this project adheres to
8787
primary cosmwasm_std dependency of a contract.
8888
- cosmwasm-vm: Enable partial reference-type support, enabling contracts
8989
compiled with Rust 1.82 or newer to be stored. ([#2473])
90+
- cosmwasm-std: Removed IBC fees ([#2479])
9091

9192
## Fixed
9293

@@ -130,6 +131,7 @@ and this project adheres to
130131
[#2472]: https://github.com/CosmWasm/cosmwasm/pull/2472
131132
[#2473]: https://github.com/CosmWasm/cosmwasm/pull/2473
132133
[#2477]: https://github.com/CosmWasm/cosmwasm/pull/2477
134+
[#2479]: https://github.com/CosmWasm/cosmwasm/pull/2479
133135

134136
## [2.2.0] - 2024-12-17
135137

packages/go-gen/tests/cosmwasm_std__IbcMsg.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,12 @@ type WriteAcknowledgementMsg struct {
2121
type CloseChannelMsg struct {
2222
ChannelID string `json:"channel_id"`
2323
}
24-
type PayPacketFeeMsg struct {
25-
// The channel id on the chain where the packet is sent from (this chain).
26-
ChannelID string `json:"channel_id"`
27-
Fee IBCFee `json:"fee"`
28-
// The port id on the chain where the packet is sent from (this chain).
29-
PortID string `json:"port_id"`
30-
// Allowlist of relayer addresses that can receive the fee. This is currently not implemented and *must* be empty.
31-
Relayers Array[string] `json:"relayers"`
32-
}
33-
type PayPacketFeeAsyncMsg struct {
34-
// The channel id on the chain where the packet is sent from (this chain).
35-
ChannelID string `json:"channel_id"`
36-
Fee IBCFee `json:"fee"`
37-
// The port id on the chain where the packet is sent from (this chain).
38-
PortID string `json:"port_id"`
39-
// Allowlist of relayer addresses that can receive the fee. This is currently not implemented and *must* be empty.
40-
Relayers Array[string] `json:"relayers"`
41-
// The sequence number of the packet that should be incentivized.
42-
Sequence uint64 `json:"sequence"`
43-
}
4424

4525
type IBCMsg struct {
4626
Transfer *TransferMsg `json:"transfer,omitempty"`
4727
SendPacket *SendPacketMsg `json:"send_packet,omitempty"`
4828
WriteAcknowledgement *WriteAcknowledgementMsg `json:"write_acknowledgement,omitempty"`
4929
CloseChannel *CloseChannelMsg `json:"close_channel,omitempty"`
50-
PayPacketFee *PayPacketFeeMsg `json:"pay_packet_fee,omitempty"`
51-
PayPacketFeeAsync *PayPacketFeeAsyncMsg `json:"pay_packet_fee_async,omitempty"`
5230
}
5331

5432
// Coin is a string representation of the sdk.Coin type (more portable than sdk.Int)
@@ -60,11 +38,6 @@ type Coin struct {
6038
type IBCAcknowledgement struct {
6139
Data []byte `json:"data"`
6240
}
63-
type IBCFee struct {
64-
AckFee Array[Coin] `json:"ack_fee"`
65-
ReceiveFee Array[Coin] `json:"receive_fee"`
66-
TimeoutFee Array[Coin] `json:"timeout_fee"`
67-
}
6841

6942
// IBCTimeout is the timeout for an IBC packet. At least one of block and timestamp is required.
7043
type IBCTimeout struct {

packages/go-gen/tests/cosmwasm_std__IbcQuery.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@ type ChannelQuery struct {
66
// optional argument
77
PortID string `json:"port_id,omitempty"`
88
}
9-
type FeeEnabledChannelQuery struct {
10-
ChannelID string `json:"channel_id"`
11-
PortID string `json:"port_id,omitempty"`
12-
}
139

1410
// IBCQuery defines a query request from the contract into the chain.
1511
// This is the counterpart of [IbcQuery](https://github.com/CosmWasm/cosmwasm/blob/v0.14.0-beta1/packages/std/src/ibc.rs#L61-L83).
1612
type IBCQuery struct {
17-
PortID *PortIDQuery `json:"port_id,omitempty"`
18-
Channel *ChannelQuery `json:"channel,omitempty"`
19-
FeeEnabledChannel *FeeEnabledChannelQuery `json:"fee_enabled_channel,omitempty"`
13+
PortID *PortIDQuery `json:"port_id,omitempty"`
14+
Channel *ChannelQuery `json:"channel,omitempty"`
2015
}

packages/std/src/ibc.rs

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -75,83 +75,6 @@ pub enum IbcMsg {
7575
/// This will close an existing channel that is owned by this contract.
7676
/// Port is auto-assigned to the contract's IBC port
7777
CloseChannel { channel_id: String },
78-
/// Incentivizes the next IBC packet sent after this message with a fee.
79-
/// Note that this does not necessarily have to be a packet sent by this contract.
80-
/// The fees are taken from the contract's balance immediately and locked until the packet is handled.
81-
///
82-
/// # Example
83-
///
84-
/// Most commonly, you will attach this message to a response right before sending a packet using
85-
/// [`IbcMsg::SendPacket`] or [`IbcMsg::Transfer`].
86-
///
87-
/// ```rust
88-
/// # use cosmwasm_std::{IbcMsg, IbcEndpoint, IbcFee, IbcTimeout, Coin, coins, CosmosMsg, Response, Timestamp};
89-
///
90-
/// let incentivize = IbcMsg::PayPacketFee {
91-
/// port_id: "transfer".to_string(),
92-
/// channel_id: "source-channel".to_string(),
93-
/// fee: IbcFee {
94-
/// receive_fee: coins(100, "token"),
95-
/// ack_fee: coins(201, "token"),
96-
/// timeout_fee: coins(200, "token"),
97-
/// },
98-
/// relayers: vec![],
99-
/// };
100-
/// let transfer = IbcMsg::Transfer {
101-
/// channel_id: "source-channel".to_string(),
102-
/// to_address: "receiver".to_string(),
103-
/// amount: Coin::new(100u32, "token"),
104-
/// timeout: IbcTimeout::with_timestamp(Timestamp::from_nanos(0)),
105-
/// memo: None,
106-
/// };
107-
///
108-
/// # #[cfg(feature = "stargate")]
109-
/// let _: Response = Response::new()
110-
/// .add_message(CosmosMsg::Ibc(incentivize))
111-
/// .add_message(CosmosMsg::Ibc(transfer));
112-
/// ```
113-
#[cfg(feature = "cosmwasm_2_2")]
114-
PayPacketFee {
115-
/// The port id on the chain where the packet is sent from (this chain).
116-
port_id: String,
117-
/// The channel id on the chain where the packet is sent from (this chain).
118-
channel_id: String,
119-
fee: IbcFee,
120-
/// Allowlist of relayer addresses that can receive the fee.
121-
/// An empty list means that any relayer can receive the fee.
122-
///
123-
/// This is currently not implemented and *must* be empty.
124-
relayers: Vec<String>,
125-
},
126-
/// Incentivizes the existing IBC packet with the given port, channel and sequence with a fee.
127-
/// Note that this does not necessarily have to be a packet sent by this contract.
128-
/// The fees are taken from the contract's balance immediately and locked until the packet is handled.
129-
/// They are added to the existing fees on the packet.
130-
#[cfg(feature = "cosmwasm_2_2")]
131-
PayPacketFeeAsync {
132-
/// The port id on the chain where the packet is sent from (this chain).
133-
port_id: String,
134-
/// The channel id on the chain where the packet is sent from (this chain).
135-
channel_id: String,
136-
/// The sequence number of the packet that should be incentivized.
137-
sequence: u64,
138-
fee: IbcFee,
139-
/// Allowlist of relayer addresses that can receive the fee.
140-
/// An empty list means that any relayer can receive the fee.
141-
///
142-
/// This is currently not implemented and *must* be empty.
143-
relayers: Vec<String>,
144-
},
145-
}
146-
147-
#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq, Eq, JsonSchema)]
148-
pub struct IbcFee {
149-
// the packet receive fee
150-
pub receive_fee: Vec<Coin>,
151-
// the packet acknowledgement fee
152-
pub ack_fee: Vec<Coin>,
153-
// the packet timeout fee
154-
pub timeout_fee: Vec<Coin>,
15578
}
15679

15780
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]

packages/std/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub use crate::ibc::IbcChannelOpenResponse;
7171
pub use crate::ibc::{
7272
Ibc3ChannelOpenResponse, IbcAckCallbackMsg, IbcAcknowledgement, IbcBasicResponse,
7373
IbcCallbackRequest, IbcChannel, IbcChannelCloseMsg, IbcChannelConnectMsg, IbcChannelOpenMsg,
74-
IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcFee, IbcMsg, IbcOrder, IbcPacket,
74+
IbcDestinationCallbackMsg, IbcDstCallback, IbcEndpoint, IbcMsg, IbcOrder, IbcPacket,
7575
IbcPacketAckMsg, IbcPacketReceiveMsg, IbcPacketTimeoutMsg, IbcReceiveResponse,
7676
IbcSourceCallbackMsg, IbcSrcCallback, IbcTimeout, IbcTimeoutBlock, IbcTimeoutCallbackMsg,
7777
TransferMsgBuilder,
@@ -96,9 +96,9 @@ pub use crate::query::{
9696
BankQuery, BondedDenomResponse, ChannelResponse, CodeInfoResponse, ContractInfoResponse,
9797
CustomQuery, DecCoin, Delegation, DelegationResponse, DelegationRewardsResponse,
9898
DelegationTotalRewardsResponse, DelegatorReward, DelegatorValidatorsResponse,
99-
DelegatorWithdrawAddressResponse, DenomMetadataResponse, DistributionQuery,
100-
FeeEnabledChannelResponse, FullDelegation, GrpcQuery, IbcQuery, PortIdResponse, QueryRequest,
101-
StakingQuery, SupplyResponse, Validator, ValidatorResponse, WasmQuery,
99+
DelegatorWithdrawAddressResponse, DenomMetadataResponse, DistributionQuery, FullDelegation,
100+
GrpcQuery, IbcQuery, PortIdResponse, QueryRequest, StakingQuery, SupplyResponse, Validator,
101+
ValidatorResponse, WasmQuery,
102102
};
103103
#[cfg(all(feature = "stargate", feature = "cosmwasm_1_2"))]
104104
pub use crate::results::WeightedVoteOption;

packages/std/src/query/ibc.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,6 @@ pub enum IbcQuery {
2828
channel_id: String,
2929
port_id: Option<String>,
3030
},
31-
/// Queries whether the given channel supports IBC fees.
32-
/// If port_id is omitted, it will default to the contract's own channel.
33-
/// (To save a PortId{} call)
34-
///
35-
/// Returns a `FeeEnabledChannelResponse`.
36-
#[cfg(feature = "cosmwasm_2_2")]
37-
FeeEnabledChannel {
38-
port_id: Option<String>,
39-
channel_id: String,
40-
},
4131
}
4232

4333
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
@@ -55,11 +45,3 @@ pub struct ChannelResponse {
5545
}
5646

5747
impl_response_constructor!(ChannelResponse, channel: Option<IbcChannel>);
58-
59-
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
60-
#[non_exhaustive]
61-
pub struct FeeEnabledChannelResponse {
62-
pub fee_enabled: bool,
63-
}
64-
65-
impl_response_constructor!(FeeEnabledChannelResponse, fee_enabled: bool);

packages/std/src/testing/mock.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,12 +1148,6 @@ impl IbcQuerier {
11481148
};
11491149
to_json_binary(&res).into()
11501150
}
1151-
#[cfg(feature = "cosmwasm_2_2")]
1152-
IbcQuery::FeeEnabledChannel { .. } => {
1153-
use crate::query::FeeEnabledChannelResponse;
1154-
// for now, we always return true
1155-
to_json_binary(&FeeEnabledChannelResponse::new(true)).into()
1156-
}
11571151
};
11581152
// system result is always ok in the mock implementation
11591153
SystemResult::Ok(contract_result)

0 commit comments

Comments
 (0)