This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Copy link
Copy link
Open
Labels
I3-bugFails to follow expected behavior.Fails to follow expected behavior.
Description
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.
polkadot/runtime/parachains/src/hrmp.rs
Lines 651 to 678 in 4b2bd54
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
Labels
I3-bugFails to follow expected behavior.Fails to follow expected behavior.