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

Pallets: Treasury deprecate propose_spend dispatchable #14538

Merged

Conversation

muharem
Copy link
Contributor

@muharem muharem commented Jul 8, 2023

Deprecate propose_spend dispatchable and it's dependant dispatchables, reject_proposal and approve_proposal.

The spend dispatchable is expected to be used instead.

Deprecation Issue: paritytech/polkadot-sdk#138

@muharem muharem 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 Jul 8, 2023
@muharem muharem requested review from a team July 8, 2023 09:25
@@ -346,6 +346,10 @@ pub mod pallet {
/// - O(1)
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::propose_spend())]
#[allow(deprecated)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

wonder if developers will notice these deprecations, may be there is a better way to deprecate dispatchables?
this at least will be included in release notes

Copy link
Member

Choose a reason for hiding this comment

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

You mean the pr will be included? Otherwise no one really will see this from the upper layers.

Copy link
Member

Choose a reason for hiding this comment

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

The metadata does not carry deprecation info, or?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bkchr yes, which is a good part.
the combination of #[allow(deprecated)] and #[deprecated(...)] for one item looks hacky.
may be whitelisting those warnings could be a solution.

@ggwpez just checked, it does not. you can see it in rococo contracts, the contracts pallet has deprecated calls.
but it does include docs, so we could include it into docs.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a deprecation issue for it - https://github.com/paritytech/substrate/issues/14732
Can you please review the PR
I did not add anything to metadata since there is no agreement on it yet.

#[allow(deprecated)]
#[deprecated(
note = "`reject_proposal` will be removed in February 2024. Use `spend` instead."
)]
pub fn reject_proposal(
Copy link
Member

Choose a reason for hiding this comment

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

You could rename them to deprecated_reject_proposal. Then the info will be in the metadata and visible to downstream devs/users.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it can be a solution actually, but I would first agree on it and have it as a standard to not create multiple ways of deprecating

@juangirini
Copy link
Contributor

I know that "Remove usage of the deprecated feature in the code base" is listed as a separate item in the deprecation process, but I think we should already use the new syntax instead of using#[allow(deprecated)] everywhere

@ggwpez
Copy link
Member

ggwpez commented Aug 9, 2023

I know that "Remove usage of the deprecated feature in the code base" is listed as a separate item in the deprecation process, but I think we should already use the new syntax instead of using#[allow(deprecated)] everywhere

But we have to keep the tests in tact for as long as the code is not completely removed, otherwise it could silentlybreak.
The #[allow(deprecated)] is just for the tests here.

@muharem
Copy link
Contributor Author

muharem commented Aug 10, 2023

but merge

@muharem
Copy link
Contributor Author

muharem commented Aug 10, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 884a288 into master Aug 10, 2023
9 checks passed
@paritytech-processbot paritytech-processbot bot deleted the muharem-treasury-deprecate-dispatchables branch August 10, 2023 13:35
Ank4n pushed a commit that referenced this pull request Aug 20, 2023
* treasury deprecate dispatchables

* allow deprecated

* allow deprecated for benchmarks

* allow deprecated in tests

* allow deprecated for bounties tests

* deprecation month
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
None yet
Development

Successfully merging this pull request may close these issues.

6 participants