Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[Zombienet] add dummy upgrade test #4660

Merged
merged 6 commits into from
Jan 20, 2022
Merged

Conversation

pepoviola
Copy link
Contributor

@pepoviola pepoviola commented Jan 5, 2022

UPDATED cc @pepyakin / @ordian

Zombienet new available commands

  • <node name>: parachain perform dummy upgrade within x seconds

Zombienet will connect to the collator and get the :code, after decompress a custom section is appended to the wasm and re-compressed. The new compressed code is used to perform the upgrade and then zombienet will try to match the new hash in the <node name> defined for x amount of seconds.

  • <node name>: parachain perform upgrade with within x seconds

Zombienetwill download the wasm from the provided url and use it for perform the upgrade. Then will try to match the new hash in the <node name> defined for x amount of seconds.

NOTE: The images for the relay chain nodes and collator are fixed to polkadot:latest and polkadot-collator:latest. I try using the paritypr for the relay chain nodes but the collator produce this error:

2022-01-13 10:45:04 | Error: Input("Relay chain argument error: Invalid input: Error parsing spec file: unknown field `forkId` at line 157 column 1")

I'm not sure if we want to set this test to run with those fixed version in the CI or we want to make it works with the image produced by the pr (docker.io/paritypr/synth-wave).

Thanks!!

@pepoviola pepoviola added I5-tests Tests need fixing, improving or augmenting. A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. labels Jan 5, 2022
@pepoviola pepoviola requested a review from a team as a code owner January 5, 2022 13:31
@ordian
Copy link
Member

ordian commented Jan 5, 2022

Thanks!

A couple of things:

  1. The naming generate dummy upgrade is a bit incomplete, because IIUC you also apply the upgrade, not only generate it.
    Is it possible to rename to chain upgrade dummy?
  2. Is it possible to support urls instead of path for runtime upgrade? I assume we don't want to store a few megabytes in the git history.
  3. Maybe replace chain with parachain 100 for clarity?

@pepoviola
Copy link
Contributor Author

pepoviola commented Jan 5, 2022

Hi @ordian, thanks for the feedback! Related to your points:

  • The naming generate dummy upgrade is a bit incomplete, because IIUC you also apply the upgrade, not only generate it.

Yes, generate and perform the upgrade. I think we can use perform dummy upgrade since the generation is implied.

Is it possible to rename to chain upgrade dummy?

Yes, we can agree to use a better expression.

  • Is it possible to support urls instead of path for runtime upgrade? I assume we don't want to store a few megabytes in the git history.

Yes, support url is a better option here.

  • Maybe replace chain with parachain 100 for clarity?

Something like:

alice: parachain 100 perform dummy upgrade

or

alice: parachain 100 perform upgrade with <wasm url>

quick question: Do we need to be explicit about parachain Id?

Thanks!

@ordian
Copy link
Member

ordian commented Jan 5, 2022

quick question: Do we need to be explicit about parachain Id?

For tests where we have more than one parachain. But we currently don't have such tests.

@pepoviola pepoviola marked this pull request as draft January 5, 2022 16:03
@pepoviola pepoviola marked this pull request as ready for review January 13, 2022 18:06
@pepoviola pepoviola requested a review from drahnr January 13, 2022 18:07
.gitlab-ci.yml Outdated Show resolved Hide resolved
bob: is up
alice: parachain 100 is registered within 225 seconds
alice: parachain 100 block height is at least 10 within 400 seconds
alice: parachain 100 perform dummy upgrade within 200 seconds
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the wasm blob that is used for the upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @drahnr, for this use case we generate a new wasm from the previous one by appending a custom section.

A high level process definition:

Zombienet will connect to the collator and get the :code, after decompress a custom section is appended to the wasm and re-compressed. The new compressed code is used to perform the upgrade and then zombienet will try to match the new hash in the <node name> defined for x amount of seconds.

Also, as mention in the pr this test is using polkadot-collator and polkadot latest image versions because I try with the image build within the pr but doesn't work with the collator version.

Thx!

Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Nice!

@drahnr drahnr merged commit bb03acb into master Jan 20, 2022
@drahnr drahnr deleted the jv-zombienet-add-chain-upgrade-test branch January 20, 2022 09:02
Wizdave97 pushed a commit to ComposableFi/polkadot that referenced this pull request Feb 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. I5-tests Tests need fixing, improving or augmenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zombienet: test parachain upgrades
5 participants