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-balances] burn_allow_death extrinsic #3964

Merged

Conversation

Dinonard
Copy link
Contributor

@Dinonard Dinonard commented Apr 3, 2024

Adds an additional extrinsic call to the pallet-balances to burn tokens.
Depending on the keep_alive flag, the call might or might not reap the account.

Required modification of the fungible's Mutate trait, burn_from function to allow the Preservation argument.

TODO

  • run benchmarks & update weights
  • make sure prdoc is required & properly formatted

Related issue: #3943

@Dinonard Dinonard mentioned this pull request Apr 3, 2024
2 tasks
@Dinonard Dinonard requested a review from a team as a code owner April 3, 2024 11:41
#[pallet::weight(T::WeightInfo::burn_allow_death())]
pub fn burn_allow_death(
origin: OriginFor<T>,
#[pallet::compact] value: T::Balance,
Copy link
Member

Choose a reason for hiding this comment

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

An additional call is overkill, but a keep_alive: bool similar to thetransfer_all would be fine i think.

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 don't mind doing that, but will need to change this function signature:
https://github.com/paritytech/polkadot-sdk/blob/master/substrate/frame/support/src/traits/tokens/fungible/regular.rs#L260

It might end being a slightly lager change, hope that's ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated per request.

Will need help/suggestion with the remaining TODOs in the PR summary:

  • running benchmarks & updating weights (I cannot trigger the job)
  • check whether prdoc is ok

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 know you said in another PR that current review process isn't sustainable (I assume due to human resources), but is there someone else we can ask to take a look at the PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ggwpez sorry for the tag but could you please give a timeline when this can be checked out? Can we get someone else to review it?

Copy link
Member

Choose a reason for hiding this comment

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

Yea, it is best to ask in chat for review. We have the open #fellowship-open-channel:parity.io channel for that. I invited you.
Otherwise it can get lost or not have any priority...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks a lot!

@Dinonard Dinonard requested a review from a team as a code owner April 3, 2024 14:28
@paritytech-review-bot paritytech-review-bot bot requested a review from a team April 3, 2024 14:29
@ggwpez ggwpez requested review from a team and ggwpez and removed request for a team April 30, 2024 10:36
substrate/frame/balances/src/benchmarking.rs Outdated Show resolved Hide resolved
substrate/frame/balances/src/lib.rs Outdated Show resolved Hide resolved
substrate/frame/balances/src/lib.rs Show resolved Hide resolved
@ggwpez ggwpez added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Apr 30, 2024
@ggwpez
Copy link
Member

ggwpez commented Apr 30, 2024

bot bench-all pallet --pallet=pallet_balances

@command-bot
Copy link

command-bot bot commented Apr 30, 2024

@ggwpez https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6092354 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench-all/bench-all.sh" --pallet=pallet_balances. Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 4-02c5a23e-ef01-4cbd-aba7-be284195e69c to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Apr 30, 2024

@ggwpez Command "$PIPELINE_SCRIPTS_DIR/commands/bench-all/bench-all.sh" --pallet=pallet_balances has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6092354 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6092354/artifacts/download.

Dinonard and others added 6 commits April 30, 2024 14:11
…s/pallet_balances.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
…trinsics' into dinonard/pallet-balances-burn-extrinsics
@command-bot
Copy link

command-bot bot commented May 8, 2024

@mordamax option '--runtime ' argument 'rococo-dev' is invalid. Allowed choices are rococo, westend.

@mordamax
Copy link
Contributor

mordamax commented May 8, 2024

bot bench polkadot-pallet --pallet=pallet_balances --runtime=rococo

@command-bot
Copy link

command-bot bot commented May 8, 2024

@mordamax https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6156561 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=rococo --target_dir=polkadot --pallet=pallet_balances. Check out https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 1-c26120b1-4f7e-40f2-9c19-05d76c505cc4 to cancel this command or bot cancel to cancel all commands in this pull request.

…=rococo --target_dir=polkadot --pallet=pallet_balances
@command-bot
Copy link

command-bot bot commented May 8, 2024

@mordamax Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=rococo --target_dir=polkadot --pallet=pallet_balances has finished. Result: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6156561 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/6156561/artifacts/download.

@mordamax
Copy link
Contributor

mordamax commented May 8, 2024

@Dinonard looks good now. I will need to make sure those ones are part of bench-all pallet 👍

@liamaharon liamaharon added this pull request to the merge queue May 8, 2024
Merged via the queue into paritytech:master with commit c3e57c1 May 8, 2024
146 of 147 checks passed
@Dinonard
Copy link
Contributor Author

Dinonard commented May 8, 2024

Thank you all for the support!

paritytech-ci pushed a commit that referenced this pull request May 8, 2024
Adds an additional extrinsic call to the `pallet-balances` to _burn_
tokens.
Depending on the `keep_alive` flag, the call might or might not reap the
account.

Required modification of the _fungible's_ `Mutate` trait, `burn_from`
function to allow the `Preservation` argument.

**TODO**
- [x] run benchmarks & update weights
- [x] make sure prdoc is required & properly formatted

Related issue: #3943

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
hitchhooker pushed a commit to ibp-network/polkadot-sdk that referenced this pull request Jun 5, 2024
Adds an additional extrinsic call to the `pallet-balances` to _burn_
tokens.
Depending on the `keep_alive` flag, the call might or might not reap the
account.

Required modification of the _fungible's_ `Mutate` trait, `burn_from`
function to allow the `Preservation` argument.

**TODO**
- [x] run benchmarks & update weights
- [x] make sure prdoc is required & properly formatted

Related issue: paritytech#3943

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
TarekkMA pushed a commit to moonbeam-foundation/polkadot-sdk that referenced this pull request Aug 2, 2024
Adds an additional extrinsic call to the `pallet-balances` to _burn_
tokens.
Depending on the `keep_alive` flag, the call might or might not reap the
account.

Required modification of the _fungible's_ `Mutate` trait, `burn_from`
function to allow the `Preservation` argument.

**TODO**
- [x] run benchmarks & update weights
- [x] make sure prdoc is required & properly formatted

Related issue: paritytech#3943

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Aug 28, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Aug 29, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Sep 4, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Sep 4, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Sep 4, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Sep 4, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in GenericChainSpec struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to `MockValidationDataInherentDataProvider` to make it more prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release 1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release 1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)

issue-2025
issue-1983
enddynayn added a commit to frequency-chain/frequency that referenced this pull request Sep 4, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async
backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death
extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain
Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in
GenericChainSpec
struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to
`MockValidationDataInherentDataProvider` to make it more
prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook
feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release
1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release
1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async
Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)


#2025 
#1983
rustadot pushed a commit to rustadot/recurrency that referenced this pull request Sep 5, 2024
- Upgrade Polkadot-sdk 1.10.0 to 1.13.0
- Update weights to reflect the new version.1.13.0

Notable Changes:
Polkadot-sdk 1.12.0
- [Improve MockValidationDataInherentDataProvider to support async
backing](paritytech/polkadot-sdk#4442)
- [Balances-Pallet add burn_allow_death
extrinsic](paritytech/polkadot-sdk#3964)
- [Add Async Backing to Parachain
Template](paritytech/polkadot-sdk#4295)

Polkadot-sdk 1.13.0
- [DeprecatedRuntimeGenesisConfig generic type parameter in
GenericChainSpec
struct](paritytech/polkadot-sdk#4410)
- [Move the `para_id` from `MockXcmConfig` to
`MockValidationDataInherentDataProvider` to make it more
prominent](paritytech/polkadot-sdk#4555)
- [Remove parameterized-consensus-hook
feature](paritytech/polkadot-sdk#4380)

For more details, please refer to:
- [Polkadot-sdk release
1.12.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.12.0)
- [Polkadot-sdk release
1.13.0](https://github.com/paritytech/polkadot-sdk/releases/polkadot-v1.13.0)
- [Async
Backing](https://wiki.polkadot.network/docs/maintain-guides-async-backing)


#2025 
#1983
magecnion added a commit to freeverseio/laos that referenced this pull request Sep 12, 2024
asiniscalchi added a commit to freeverseio/laos that referenced this pull request Nov 29, 2024
* uplift to stable2407

* paritytech/polkadot-sdk#4831

* paritytech/polkadot-sdk#3820

* polkadot-evm/frontier#1253

* paritytech/polkadot-sdk#3952

* paritytech/polkadot-sdk#3872

* fix rpc_builder type

* paritytech/polkadot-sdk#4410

* paritytech/polkadot-sdk#4097

* use stable rust toolchain

* paritytech/polkadot-sdk#3964

* cargo fmt

* clippy and lint issues

* e2e-test estimate gas when delegating

* only run staking e2e-test so it's easier for reviewing by external

* only run staking e2e-test so it's easier for reviewing by external

* restore run all e2e tests

* Update Rust Toolchain to 1.77, Suppress Warnings, and Enhance Runtime (#778)

* using runt 1.77

* fix clippy errors

* fixing clippy

* update to runtime 2200

* update proyect version to 0.22.0

* add missing migration

* removed the upgrade of versioning

* update cargo.lock

* using runtime

* fix  command

* fix compilation

* fix metadata test

* missing Config associated type

* modify MaxPageSize to the original till we need to increase it

* use latest release for zombienet tests

* go back to stable2407-3 release for zombienet tests

* go back to previous MaxPageSize

---------

Co-authored-by: Alessandro Siniscalchi <asiniscalchi@gmail.com>
Co-authored-by: luispdm <17044119+luispdm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T1-FRAME This PR/Issue is related to core FRAME, the framework.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants