-
Notifications
You must be signed in to change notification settings - Fork 769
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
Allow early refund of slot deposit #1749
Conversation
|
||
// If this is less than what we were holding for this leaser's now-ended lease, | ||
// then unreserve it. | ||
if let Some(rebate) = ended_lease.1.checked_sub(&now_held) { | ||
let current_hold = ended_lease.1; | ||
// Fixme(ank4n): check reserved balance from state instead of deposit. We might |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fungibles would fix this but probably shouldn't migrate in this PR
The CI pipeline was cancelled due to failure one of the required jobs. |
/// to get access to their funds they used in the last lease and rebid using same for the | ||
/// next lease. | ||
/// | ||
/// Can only be called by the Lease Admin or the Parachain manager. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like Registrar
and ForceOrigin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registrar is responsible for registration of para_id. We get the manager of para_id from the registrar.
Good point about Force Origin, I will fix the doc. The ForceOrigin is set to be LeaseAdmin origin in the polkadot and kusama runtimes but from this pallet's POV, it could be any configured origin.
I guess its too late to be useful anymore? @SBalaguer Closing this PR. |
closes #877
context: https://hackmd.io/4OLfULI6RtaPdE-L_hur4g
Changes since last approach (Updated on 19th Nov):
Instead of having a config value that determines how early refund can be applied before the slot expiry, now early refund can only be applied anytime during the last LP of the lease. Parachains should have at minimum
MinLeasePeriodsForEarlyRefund
LPs in their current lease to be able to refund early.Summary
This change would allow a parachain to refund their slot deposit during their last lease period, given that they leased out minimum of
MinLeasePeriodsForEarlyRefund
in the last auction. For parachains who won the lease with a crowdloan, they could then refund crowdloan funds to contributors, and dissolve the crowdloan. This gives them opportunity to either start a new crowdloan or bid directly with their released funds.If
MinLeasePeriodsForEarlyRefund
is set to0
, a slot deposit can never be refunded before it expires.Changes
MinLeasePeriodsForEarlyRefund
: Determines how many minimum lease periods a leaser in their latest lease to be eligible for early refund. This value should always be greater than 0. If set to 0,early_lease_refund
is disabled.early_lease_refund
: Only para or para manager can call this or can be executed via governance with Lease Admin origin track. It allows a parachain to unreserve their lease deposit during the last lease period of their full lease. This will unreserve the deposit of the slot but would not downgrade the parachain yet. Parachain would be downgraded as it happens today if at the start of the next lease period it does not have any new leases remaining or left alone if a new lease has become available and update the fund reserved to match the new requirement.LeaseInfo
: Keeps track of how much funds is reserved as well as period count of the latest lease for a leaser.early_lease_refund
can be followed by the callsrefund
anddissolve
on the crowdloan pallet for the para_id which will remove the crowdloan and allow the parachain to create a new crowdloan for the same para_id.TODO
early_lease_refund
is not called. This ensures we do not impact any existing flows.early_lease_refund
.early_lease_refund
).early_lease_refund
.