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-contracts: Do not return an error on already applied upgrades #2077

Closed
wants to merge 4 commits into from

Conversation

bkchr
Copy link
Member

@bkchr bkchr commented Oct 30, 2023

Migrations in general should just skip the operation, if they were already applied. This is especially useful for CI checks that run in each pr to check that the current set of migrations are valid.

Migrations in general should just skip the operation, if they were
already applied. This is especially useful for CI checks that run in
each pr to check that the current set of migrations are valid.
@bkchr bkchr added the R0-silent Changes should not be mentioned in any release notes label Oct 30, 2023
@bkchr bkchr requested a review from pgherveou October 30, 2023 08:54
@bkchr bkchr requested a review from athei as a code owner October 30, 2023 08:54
@bkchr bkchr requested a review from a team October 30, 2023 08:54
@pgherveou
Copy link
Contributor

Migrations in general should just skip the operation, if they were already applied. This is especially useful for CI checks that run in each pr to check that the current set of migrations are valid.

agreed, let me update that to a warn log. I think the is_upgrade_supported might need to be adjusted as well. Double checking..

@bkchr
Copy link
Member Author

bkchr commented Oct 30, 2023

agreed, let me update that to a warn log. I think the is_upgrade_supported might need to be adjusted as well. Double checking..

There is a warn in on_runtime_upgrade.

@bkchr bkchr enabled auto-merge (squash) October 30, 2023 09:16
@paritytech-cicd-pr
Copy link

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

@liamaharon
Copy link
Contributor

already fixed #2079

@liamaharon liamaharon closed this Oct 30, 2023
auto-merge was automatically disabled October 30, 2023 12:01

Pull request was closed

@pgherveou
Copy link
Contributor

pgherveou commented Oct 30, 2023

@liamaharon
I feel that this fix here is a bit more accurate, if a migration step is missing we should panic in try_runtime not just log a warning, it means that the migration will for sure fails on_runtime_upgrade.

This should stay

ensure!(
	T::Migrations::is_upgrade_supported(on_chain_version, current_version),
	"Unsupported upgrade: VERSION_RANGE should be (on-chain storage version + 1, current storage version)"
);

the noop case though should just trigger a warning.
Maybe I am missing something, feel free to comment and re-close again

@liamaharon
Copy link
Contributor

liamaharon commented Oct 30, 2023

@pgherveou can that case be hit during normal execution (if the migration is left in the Executive tuple indefinitely) or does it only exec in an error path?

pgherveou added a commit that referenced this pull request Oct 31, 2023
pgherveou added a commit that referenced this pull request Oct 31, 2023
bgallois pushed a commit to duniter/duniter-polkadot-sdk that referenced this pull request Mar 25, 2024
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Mar 26, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Mar 26, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 8c8adaf.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Mar 27, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Mar 27, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit be915cb.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
serban300 added a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (paritytech#2064)" (paritytech#2077)"

This reverts commit 62f749e.

* Adjustments
bkchr pushed a commit that referenced this pull request Apr 10, 2024
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* Use wasm execution on millau and rialto

It's safer like this since here are some errors that aren't caught when
using native execution

* Revert "Revert "Fix max-size messages at test chains (#2064)" (#2077)"

This reverts commit 62f749e.

* Adjustments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants