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

Collective: dynamic deposit based on number of proposals #3151

Merged
merged 68 commits into from
Sep 4, 2024

Conversation

muharem
Copy link
Contributor

@muharem muharem commented Jan 31, 2024

Introduce a dynamic proposal deposit mechanism influenced by the total number of active proposals, with the option to set the deposit to none.

The potential cost (e.g., balance hold) for proposal submission and storage is determined by the implementation of the Consideration trait. The footprint is defined as proposal_count, representing the total number of active proposals in the system, excluding the one currently being proposed. This cost may vary based on the proposal count. The pallet also offers various types to define a cost strategy based on the number of proposals.

Two new calls are introduced:

  • kill(origin, proposal_hash): the cancellation of a proposal, accompanied by the burning of the associated cost/consideration ticket.
  • release_proposal_cost(origin, proposal_hash): the release of the cost for a non-active proposal.

Additionally change:

  • benchmarks have been upgraded to benchmarks::v2 for collective pallet;
  • ensure_successful function added to the Consideration under runtime-benchmarks feature.

@muharem muharem added the T1-FRAME This PR/Issue is related to core FRAME, the framework. label Jan 31, 2024
@muharem muharem changed the title Collective: dynamic deposit based on number proposals Collective: dynamic deposit based on number of proposals Jan 31, 2024
@muharem muharem requested a review from a team as a code owner January 31, 2024 09:54
@muharem
Copy link
Contributor Author

muharem commented Feb 6, 2024

bot bench substrate-pallet --pallet=pallet_collective

@command-bot
Copy link

command-bot bot commented Feb 6, 2024

@muharem https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5126963 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective. 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 3-c37ecb20-20d5-44d2-8d31-8d7682461de8 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Feb 6, 2024

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

@command-bot
Copy link

command-bot bot commented Aug 31, 2024

@muharem https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7206517 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective. 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 38-7634b390-9a77-492a-bddd-4a66adf44289 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Aug 31, 2024

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

@mordamax
Copy link
Contributor

/cmd bench --runtime dev --pallet pallet_collective

Copy link

Command "bench --runtime dev --pallet pallet_collective" has started 🚀 See logs here

@mordamax
Copy link
Contributor

/cmd bench --runtime dev --pallet pallet_collective

Copy link

Command "bench --runtime dev --pallet pallet_collective" has started 🚀 See logs here

Copy link

Command "bench --runtime dev --pallet pallet_collective" has failed ❌! See logs here

Copy link

Command "bench --runtime dev --pallet pallet_collective" has failed ❌! See logs here

@muharem
Copy link
Contributor Author

muharem commented Sep 1, 2024

@mordamax there is no impl for () type. you can see it in this commit, the last /cmd removed it - e6b5891

@muharem
Copy link
Contributor Author

muharem commented Sep 1, 2024

@mordamax I run the bot to get this PR merged

@muharem
Copy link
Contributor Author

muharem commented Sep 1, 2024

bot bench substrate-pallet --pallet=pallet_collective

@command-bot
Copy link

command-bot bot commented Sep 1, 2024

@muharem https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7209062 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective. 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 40-f28d3581-88d2-4a91-85c0-155643f03b83 to cancel this command or bot cancel to cancel all commands in this pull request.

@paritytech-cicd-pr
Copy link

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

@command-bot
Copy link

command-bot bot commented Sep 1, 2024

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

@muharem
Copy link
Contributor Author

muharem commented Sep 2, 2024

bot bench substrate-pallet --pallet=pallet_collective

@command-bot
Copy link

command-bot bot commented Sep 2, 2024

@muharem https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/7211356 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=pallet --runtime=dev --target_dir=substrate --pallet=pallet_collective. 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-4da21e91-ec3f-4581-ab33-3e9f6f1ce500 to cancel this command or bot cancel to cancel all commands in this pull request.

…=dev --target_dir=substrate --pallet=pallet_collective
@command-bot
Copy link

command-bot bot commented Sep 2, 2024

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

@mordamax
Copy link
Contributor

mordamax commented Sep 2, 2024

@mordamax there is no impl for () type. you can see it in this commit, the last /cmd removed it - e6b5891

@ggwpez told me that it's perhaps of missing template for frame benches for /cmd, so I'll add shortly 🤝
Thanks !

@muharem muharem added this pull request to the merge queue Sep 4, 2024
Merged via the queue into master with commit cc3b7bb Sep 4, 2024
184 of 187 checks passed
@muharem muharem deleted the muharem-collective-deposit branch September 4, 2024 14:11
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.

8 participants