Skip to content
This repository has been 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

Open
pepyakin opened this issue Aug 1, 2021 · 0 comments
Open

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

pepyakin opened this issue Aug 1, 2021 · 0 comments
Labels
I3-bug Fails to follow expected behavior.

Comments

@pepyakin
Copy link
Contributor

pepyakin commented Aug 1, 2021

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.

@pepyakin pepyakin added the I3-bug Fails to follow expected behavior. label Aug 1, 2021
@pepyakin pepyakin added this to To Do in Cross Chain Message Transport via automation Aug 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I3-bug Fails to follow expected behavior.
Development

No branches or pull requests

1 participant