Skip to content
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

[coretime-kusama] Bump broker and add migration to import leases to fix launch issues #276

Merged

Conversation

seadanda
Copy link
Contributor

For the transition to coretime, the relay runtime upgrade includes a migration which sends a few XCMs to the coretime chain with Transacts. This calls set_lease (a broker extrinsic on the coretime chain) for all the leases that are currently in the relay state to get them a lease on the coretime chain.
This happened yesterday but the XCM didn't have enough weight and so the leases weren't migrated over. We decided to make a runtime upgrade since there was a bug with the renewals for short leases anyway. This PR solves both issues.

The bump to the broker pallet fixes a bug where very short leases (ending in the first 28 days after running start_sales) could not be renewed.

This PR includes a migration which does three things:

  1. Imports a hardcoded list of leases into the state
  2. Adds three cores to ensure there are enough cores for everyone to renew while also leaving the intended 3 for the open market
  3. restarts sales

The migration also tests the renewal fix with try-runtime.

  • Does not require a CHANGELOG entry

// Because we also run start_sales, 12 expiring leases are removed from the original 47,
// leaving 35.
let leases = Leases::<Runtime>::get();
assert_eq!(leases.len(), 35);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
assert_eq!(leases.len(), 35);
assert_eq!(leases.len(), LEASES.iter().filter(|(_, l)| sale_info.region_length * Timeslice::get() > l).count());

This should achieve the same?

Co-authored-by: Bastian Köcher <git@kchr.de>
seadanda and others added 2 commits April 19, 2024 18:13
Co-authored-by: Bastian Köcher <git@kchr.de>
@bkchr
Copy link
Contributor

bkchr commented Apr 19, 2024

/merge

@fellowship-merge-bot
Copy link
Contributor

Enabled auto-merge in Pull Request

Available commands
  • /merge: Enables auto-merge for Pull Request
  • /merge cancel: Cancels auto-merge for Pull Request
  • /merge help: Shows this menu

For more information see the documentation

@fellowship-merge-bot fellowship-merge-bot bot enabled auto-merge (squash) April 19, 2024 20:31
@fellowship-merge-bot fellowship-merge-bot bot merged commit 4211c34 into polkadot-fellows:main Apr 19, 2024
35 of 36 checks passed
bkchr added a commit that referenced this pull request Apr 19, 2024
…ix launch issues (#276)

For the transition to coretime, the relay runtime upgrade includes a
migration which sends a few XCMs to the coretime chain with Transacts.
This calls `set_lease` (a broker extrinsic on the coretime chain) for
all the leases that are currently in the relay state to get them a lease
on the coretime chain.
This happened yesterday but the XCM didn't have enough weight and so the
leases weren't migrated over. We decided to make a runtime upgrade since
there was a bug with the renewals for short leases anyway. This PR
solves both issues.

The bump to the broker pallet fixes a bug where very short leases
(ending in the first 28 days after running start_sales) could not be
renewed.

This PR includes a migration which does three things:
1. Imports a hardcoded list of leases into the state
2. Adds three cores to ensure there are enough cores for everyone to
renew while also leaving the intended 3 for the open market
3. restarts sales

The migration also tests the renewal fix with try-runtime.

- [ ] Does not require a CHANGELOG entry

---------

Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: Bastian Köcher <info@kchr.de>
@seadanda seadanda deleted the donal-kusama-leases-fix branch May 3, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants