Skip to content

[Authorize upgrade] Upgrade authorization by Polkadot relay chain #218

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

Merged
merged 5 commits into from
Apr 8, 2025

Conversation

karolk91
Copy link
Contributor

@karolk91 karolk91 commented Apr 1, 2025

This pull request introduces scenarios of Runtime upgrades authorization by Relay Chain.

Scenarios to cover:

  • Polkadot relay chain authorizes upgrade for itself
  • Polkadot relay chain authorizes upgrade for Polkadot Asset Hub
  • Polkadot relay chain authorizes upgrade for Polkadot Bridge Hub
  • Polkadot relay chain authorizes upgrade for Polkadot Coretime
  • Polkadot relay chain authorizes upgrade for Polkadot People
  • Polkadot relay chain authorizes upgrade for Polkadot Collectives

This pull request covers Polkadot Network, other PRs will be created for Kusama network and AssetHub Next based scenarios

@karolk91
Copy link
Contributor Author

karolk91 commented Apr 4, 2025

hey @xlc , @rockbmb

I would like to discuss with you the approach I used here, that I'm not sure if it looks nice.

You will notice that I've introduced test file that involve scenarios for 3 chains, and following current pattern of naming files I'm using:
chain1.chain2.chain3.test.ts

the truth is that chain3 is always Collectives, so more like
chain1.chain2.collectives.test.ts

I was wondering if that looks ok to you, or should I ignore Collectives part (as something that is fixed among tests, but will probably be skipped for notifications purposes) ?

Also, I have in mind a test that will involve all the system chains and relay chain, so something like an edge case scenario where relay chain approves upgrade for all system chains at once - how to fit that scenario? should that be part of polkadot.test.ts or maybe polkadot.allSystem.test.ts, how do you see it?

@karolk91 karolk91 marked this pull request as ready for review April 4, 2025 19:41
@karolk91 karolk91 changed the title [WIP] [Authorize upgrade] Upgrade authorization by Polkadot relay chain [Authorize upgrade] Upgrade authorization by Polkadot relay chain Apr 4, 2025
.toMatchSnapshot('collectives events emitted when sending xcm')
await governingChain.dev.newBlock()
await checkSystemEvents(governingChain, 'whitelist', 'messageQueue')
// TODO: redacting 'id' is not perfect here; but seems not possible to redact nested keys, in this case specifically only "message.id"
Copy link
Member

Choose a reason for hiding this comment

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

you can do .map(x => { x.message.id = '(redacted)'; return x }
or I can add a redactKeyPaths: string[][] and basically _.set(x, keyPath, '(redacted)') to the object

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you for looking into this, seems I must have confused/overlooked something in this case as I couldn't justify this again on second look - id is properly redacted here, no conflicts with other nested id attributes

I have removed this misleading comment - nothing to be done here

@xlc
Copy link
Member

xlc commented Apr 6, 2025

chain1.chain2.chain3.test.ts is fine. we can easily update the notification to support such case.
for the one with all the system chains, I will say just make it polkadot.test.ts

@karolk91
Copy link
Contributor Author

karolk91 commented Apr 8, 2025

chain1.chain2.chain3.test.ts is fine. we can easily update the notification to support such case. for the one with all the system chains, I will say just make it polkadot.test.ts

I have created the issue to track this here #228 separately from this PR

@karolk91 karolk91 requested a review from xlc April 8, 2025 07:23
@xlc xlc merged commit e071e7e into open-web3-stack:master Apr 8, 2025
60 checks passed
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.

2 participants