paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

Disarm `OnRuntimeUpgrade::pre/post_upgrade` `Tuple` footgun #14759

Closed liamaharon closed 1 year ago

liamaharon commented 1 year ago

Old versions of the Executive pallet calls pre_upgrade and post_upgrade on a tuple of pallets which was made a silent noop in https://github.com/paritytech/substrate/pull/12537.

This can lead to confusion, see https://github.com/paritytech/substrate/issues/13681.

This PR changes the noop behavior into a noisy error to inform devs of the incorrect usage and improves documentation so it's clear how to fix it.


also has insubstantial fix I forgot to push before I merged this PR: https://github.com/paritytech/substrate/pull/14779#discussion_r1295895030

KiChjang commented 1 year ago

CI is complaining about the [`Tuple`] syntax, which needs to be fixed.

liamaharon commented 1 year ago

bot merge