Skip to content

Conversation

@pandres95
Copy link
Contributor

@pandres95 pandres95 commented Aug 21, 2024

Related to RFC-117 (WIP).

This Pull Request aims to implement the pallet components of the Unbrick Collective.

  • [Paras] Implement unbrick method
    The Paras::unbrick method allows a given origin to change the validation code or note a head for a para.
  • [ParasRegistrar] Allow paras to delegate a manager
    This allows paras to opt-in for a delegated origin (i.e. UnbrickCollective) that can handle operations to unbrick a para.
  • [Whitelisted] Map between Dispatch Origin to Execution Origin.
    This allows using a single instance of Whitelist that executes calls to different origins depending on the caller origin, based on a mapping.

Related issues

polkadot-fellows/runtimes#376

… to change the validation code or note a head for a para.

This is part of the implementation of [Unbrick Collective](https://forum.polkadot.network/t/unbrick-collective/6931)
@pandres95 pandres95 force-pushed the feat/parachains-unbrick branch from 9217ce2 to e25eac3 Compare August 21, 2024 07:12
@pandres95 pandres95 force-pushed the feat/parachains-unbrick branch from e25eac3 to 2a5ffd4 Compare August 21, 2024 07:18
@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: test-linux-stable 1/3
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7087041

pub fn unbrick(
origin: OriginFor<T>,
para: ParaId,
maybe_new_code: Option<ValidationCode>,
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't work if called from Collectives (para) to the relay chain — but there is an alternative implemented here:
#7592

The fn unbrick function isn't really necessary and could be replaced with two batched calls:

batch(
   Paras::authorize_force_set_current_code_hash(new_validation_code),
   Paras::force_set_current_head(...)
)

We might just need to add some custom origin validation to force_set_current_head instead of using ensure_root, but that's a very minor change.

More context: polkadot-fellows/RFCs#117 (comment)

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.

3 participants