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

[pallet-broker] add extrinsic to reserve a system core without having to wait two sale boundaries #4273

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

seadanda
Copy link
Contributor

@seadanda seadanda commented Apr 24, 2024

When calling the reserve extrinsic after sales have started, the assignment will be reserved, but two sale period boundaries must pass before the core is actually assigned.

Since this can take between 28 and 56 days on production networks, a new extrinsic is introduced to shorten the timeline.

This essentially performs three actions:

  1. Reserve it (applies after two sale boundaries)
  2. Add it to the Workplan for the next sale period
  3. Add it to the Workplan for the rest of the current sale period from the next timeslice to be commmitted.

The caller must ensure that a core is first added, with most relay chain implementations having a delay of two session boundaries until it comes into effect.

Alternatively the extrinsic can be called on a core whose workload can be clobbered from now until the reservation kicks in (the sale period after the next). Any workplan entries for that core at other timeslices should be first removed by the caller.

@seadanda seadanda added the T2-pallets This PR/Issue is related to a particular pallet. label Apr 24, 2024
@seadanda seadanda self-assigned this Apr 24, 2024
@seadanda seadanda requested a review from a team as a code owner April 24, 2024 16:11
@seadanda
Copy link
Contributor Author

bot bench substrate-pallet --pallet=pallet_broker --extrinsic=force_reserve
bot bench cumulus --runtime=coretime-rococo --pallet=pallet_broker --extrinsic=force_reserve
bot bench cumulus --runtime=coretime-westend --pallet=pallet_broker --extrinsic=force_reserve

@seadanda
Copy link
Contributor Author

bot bench substrate-pallet --pallet=pallet_broker
bot bench cumulus --runtime=coretime-rococo --pallet=pallet_broker
bot bench cumulus --runtime=coretime-westend --pallet=pallet_broker

@seadanda
Copy link
Contributor Author

bot bench substrate-pallet --pallet=pallet_broker
bot bench cumulus-coretime --pallet=pallet_broker --runtime=coretime-rococo
bot bench cumulus-coretime --pallet=pallet_broker --runtime=coretime-westend

command-bot added 3 commits April 24, 2024 17:00
…=dev --target_dir=substrate --pallet=pallet_broker
…=coretime-rococo --runtime_dir=coretime --target_dir=cumulus --pallet=pallet_broker
…=coretime-westend --runtime_dir=coretime --target_dir=cumulus --pallet=pallet_broker
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6044828

@seadanda
Copy link
Contributor Author

bot clean

fellowship-merge-bot bot pushed a commit to polkadot-fellows/runtimes that referenced this pull request Apr 29, 2024
…ervention (#286)

When calling the reserve extrinsic after sales have started, the
assignment will be reserved, but two sale period boundaries must pass
before the core is actually assigned.

Since this can take between 28 and 56 days on production networks, a new
extrinsic is introduced to shorten the timeline at the "cost" of more
weight in paritytech/polkadot-sdk#4273.

This essentially performs four actions:
1. Add an additional core for the new reservation
2. Reserve it (applies after two sale boundaries)
3. Add it to the Workplan for the next sale period
4. Add it to the Workplan for the rest of the current sale period

To allow a quick People Chain onboarding on Kusama, a migration is
introduced here which does the same thing without needing to wait for a
release and to upgrade the runtimes repo.

Another migration is added to clean up an outdated assignment in state
from the old sale start before the leases were added. This avoids the
first lease (parachain 2000) losing its core to the new pool core a few
days before it is given one again with the new timeline at the end of
the new sale period 0.

---------

Co-authored-by: joe petrowski <[email protected]>
seadanda added a commit to seadanda/runtimes that referenced this pull request Apr 29, 2024
…ervention (polkadot-fellows#286)

When calling the reserve extrinsic after sales have started, the
assignment will be reserved, but two sale period boundaries must pass
before the core is actually assigned.

Since this can take between 28 and 56 days on production networks, a new
extrinsic is introduced to shorten the timeline at the "cost" of more
weight in paritytech/polkadot-sdk#4273.

This essentially performs four actions:
1. Add an additional core for the new reservation
2. Reserve it (applies after two sale boundaries)
3. Add it to the Workplan for the next sale period
4. Add it to the Workplan for the rest of the current sale period

To allow a quick People Chain onboarding on Kusama, a migration is
introduced here which does the same thing without needing to wait for a
release and to upgrade the runtimes repo.

Another migration is added to clean up an outdated assignment in state
from the old sale start before the leases were added. This avoids the
first lease (parachain 2000) losing its core to the new pool core a few
days before it is given one again with the new timeline at the end of
the new sale period 0.

---------

Co-authored-by: joe petrowski <[email protected]>
@seadanda
Copy link
Contributor Author

bot bench substrate-pallet --pallet=pallet_broker
bot bench cumulus-coretime --pallet=pallet_broker --runtime=coretime-rococo
bot bench cumulus-coretime --pallet=pallet_broker --runtime=coretime-westend

@seadanda seadanda requested review from eskimor and bkchr May 29, 2024 11:37
command-bot added 3 commits May 29, 2024 12:24
…=dev --target_dir=substrate --pallet=pallet_broker
…=coretime-westend --runtime_dir=coretime --target_dir=cumulus --pallet=pallet_broker
…=coretime-rococo --runtime_dir=coretime --target_dir=cumulus --pallet=pallet_broker
@seadanda
Copy link
Contributor Author

seadanda commented Jun 3, 2024

bot clean

@seadanda
Copy link
Contributor Author

@al3mart this is the PR I was talking about, this functionality might fit better in the coretime-sudo-wrapper that we discussed

@bkchr
Copy link
Member

bkchr commented Dec 12, 2024

fit better in the coretime-sudo-wrapper that we discussed

Not sure we need a new pallet for this. We can just add the functionality here. I know that this sudo wrapper exists in the relay chain, but the lines are very very blurry and we also have some duplicated functions etc. Just more confusing than what it helps IMO.

@bkchr
Copy link
Member

bkchr commented Dec 12, 2024

@seadanda let's get this merged.

@seadanda
Copy link
Contributor Author

OK cool, I've got some other functionality in mind that I can spec out in an issue

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/12319920113
Failed job name: test-linux-stable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants