Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Edge case where HRMP open request doesn't refund the deposits. #3544

@pepyakin

Description

@pepyakin

In case there is an HRMP open channel request and it is confirmed by both parties but one of the parties offboards until the end of the session, the deposit by the sender and the receiver won't be refunded.

if <paras::Pallet<T>>::is_valid_para(channel_id.sender)
&& <paras::Pallet<T>>::is_valid_para(channel_id.recipient)
{
<Self as Store>::HrmpChannels::insert(
&channel_id,
HrmpChannel {
sender_deposit: request.sender_deposit,
recipient_deposit: config.hrmp_recipient_deposit,
max_capacity: request.max_capacity,
max_total_size: request.max_total_size,
max_message_size: request.max_message_size,
msg_count: 0,
total_size: 0,
mqc_head: None,
},
);
<Self as Store>::HrmpIngressChannelsIndex::mutate(&channel_id.recipient, |v| {
if let Err(i) = v.binary_search(&channel_id.sender) {
v.insert(i, channel_id.sender);
}
});
<Self as Store>::HrmpEgressChannelsIndex::mutate(&channel_id.sender, |v| {
if let Err(i) = v.binary_search(&channel_id.recipient) {
v.insert(i, channel_id.recipient);
}
});
}

There was a discussion that it is alright to withhold the deposit of the offboarding party. This is because there is no way to ensure that because HRMP module is notified about the removal post factum so it is up to the para to claim its deposits before it offboards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I3-bugFails to follow expected behavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions