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

Deprecate V1 Weights #13699

Merged
merged 12 commits into from
Apr 4, 2023
Merged

Deprecate V1 Weights #13699

merged 12 commits into from
Apr 4, 2023

Conversation

ggwpez
Copy link
Member

@ggwpez ggwpez commented Mar 23, 2023

First round of cleanups to get completely rid of 1D weights. The struct will be removed soon.

🚨 Changes:

  • Remove calls alliance::close_old_weight and collective::close_old_weight.
  • Deprecate the OldWeight struct. Only exception is the contracts pallet where a copy of it resides.
  • Remove legacy runtime API call query_info_before_version_2.

Polkadot companion: paritytech/polkadot#7003
Cumulus companion: paritytech/cumulus#2431

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez ggwpez added A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit B1-note_worthy Changes should be noted in the release notes T1-runtime This PR/Issue is related to the topic “runtime”. labels Mar 23, 2023
@ggwpez ggwpez requested a review from a team March 23, 2023 17:39
@ggwpez ggwpez requested a review from athei as a code owner March 23, 2023 17:39
frame/support/src/dispatch.rs Show resolved Hide resolved
frame/alliance/src/lib.rs Outdated Show resolved Hide resolved
@athei
Copy link
Member

athei commented Mar 24, 2023

  • Deprecate the OldWeight struct. Only exception is the contracts pallet (cc @athei).

We basically need to support the old weight forever. Since existing APIs can't be changed. But we could just use u64 so we don't need to import the deprecated type.

@ggwpez
Copy link
Member Author

ggwpez commented Mar 24, 2023

We basically need to support the old weight forever. Since existing APIs can't be changed. But we could just use u64 so we don't need to import the deprecated type.

Okay, I will move the type to the contracts pallet.
Just dont want to have it in public sp-* anymore.

It is done @athei

ggwpez and others added 3 commits March 24, 2023 12:35
Co-authored-by: Koute <koute@users.noreply.github.com>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
frame/contracts/src/lib.rs Outdated Show resolved Hide resolved
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
@ggwpez ggwpez requested a review from yjhmelody March 31, 2023 13:05
ggwpez added a commit to paritytech/polkadot that referenced this pull request Apr 4, 2023
Companion for paritytech/substrate#13699

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
ggwpez added a commit to paritytech/cumulus that referenced this pull request Apr 4, 2023
Removes calls that rely on the old weight and get removed in Substrate upstream.

Companion for paritytech/substrate#13699 and paritytech/polkadot#7003

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
@ggwpez
Copy link
Member Author

ggwpez commented Apr 4, 2023

bot rebase

@paritytech-processbot
Copy link

Rebased

@ggwpez
Copy link
Member Author

ggwpez commented Apr 4, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 7bbfe73 into master Apr 4, 2023
@paritytech-processbot paritytech-processbot bot deleted the oty-old-weight-cleanup branch April 4, 2023 18:57
paritytech-processbot bot pushed a commit to paritytech/polkadot that referenced this pull request Apr 4, 2023
* Remove old calls

Companion for paritytech/substrate#13699

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
gpestana pushed a commit that referenced this pull request Apr 23, 2023
* Remove deprecated pallet calls

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Deprecate old weight

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update Runtime API

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Delete shitty code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix doctest

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/alliance/src/lib.rs

Co-authored-by: Koute <koute@users.noreply.github.com>

* Add doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* contracts: Use u64 as old weight type

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/contracts/src/lib.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Koute <koute@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: parity-processbot <>
@Polkadot-Forum
Copy link

This pull request has been mentioned on Polkadot Forum. There might be relevant details there:

https://forum.polkadot.network/t/april-updates-for-substrate-and-polkadot-devs/2764/1

AurevoirXavier added a commit to darwinia-network/darwinia that referenced this pull request Jul 11, 2023
ggwpez added a commit to ggwpez/runtimes that referenced this pull request Jul 13, 2023
* Remove old calls

Companion for paritytech/substrate#13699

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* Remove deprecated pallet calls

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Deprecate old weight

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update Runtime API

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix tests

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Delete shitty code

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix doctest

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/alliance/src/lib.rs

Co-authored-by: Koute <koute@users.noreply.github.com>

* Add doc

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* contracts: Use u64 as old weight type

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Update frame/contracts/src/lib.rs

Co-authored-by: Alexander Theißen <alex.theissen@me.com>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Koute <koute@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: parity-processbot <>
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. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants