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

removed without_storage_info from pallet-collective #1445

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

muraca
Copy link
Contributor

@muraca muraca commented Sep 7, 2023

Closes #167

  • Voting is now bounded
  • Members is now bounded
  • Proposal and ProposalOf have been removed
  • Voting is now a CountedStorageMap to handle the MaxProposals bound
  • Preimages has been introduced as a dependency to store proposals, using traits QueryPreimage and StorePreimage

Voting might eventually be converted into a BoundedMap theorized in #141

Polkadot address: 12poSUQPtcF1HUPQGY3zZu2P8emuW9YnsPduA4XG3oCEfJVp

@muraca muraca force-pushed the issue#167 branch 5 times, most recently from 6d401ff to c2751c4 Compare September 9, 2023 10:12
@muraca muraca marked this pull request as ready for review September 9, 2023 12:45
@muraca
Copy link
Contributor Author

muraca commented Sep 9, 2023

@ggwpez @juangirini this is ready for review, and needs new weights

@paritytech-ci paritytech-ci requested review from a team September 10, 2023 19:19
@paritytech-ci paritytech-ci requested a review from a team September 10, 2023 19:50
@juangirini juangirini added T1-FRAME This PR/Issue is related to core FRAME, the framework. T2-pallets This PR/Issue is related to a particular pallet. and removed T1-FRAME This PR/Issue is related to core FRAME, the framework. labels Sep 10, 2023
@muraca muraca requested a review from a team September 11, 2023 19:24
Copy link
Contributor

@liamaharon liamaharon left a comment

Choose a reason for hiding this comment

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

Looking good!

On the migration side, this needs:

  • An implementation of OnRuntimeUpgrade including pre/post_upgrade hooks to ensure successful migration
  • Unit tests for the OnRuntimeUpgrade struct
  • The OnRuntimeUpgrade added to the Executive pallet Migrations tuple for all runtimes that use the pallet

Let me know if you have any questions

@paritytech-ci paritytech-ci requested a review from a team September 12, 2023 06:13
@muraca muraca force-pushed the issue#167 branch 2 times, most recently from c987be4 to f52aac8 Compare September 18, 2023 07:39
@liamaharon
Copy link
Contributor

bot bench $ pallet dev pallet-collective

@command-bot
Copy link

command-bot bot commented Sep 18, 2023

@liamaharon Positional arguments are not supported anymore. I guess you meant bot bench substrate-pallet --pallet=pallet-collective, but I could be wrong.
Read docs to find out how to run your command.

@liamaharon
Copy link
Contributor

bot bench substrate-pallet --pallet=pallet-collective

@command-bot
Copy link

command-bot bot commented Sep 18, 2023

@liamaharon option '--pallet ' argument 'pallet-collective' is invalid. argument pallet is not matching rule ^([a-z_]+)([:]{2}[a-z_]+)?$

@liamaharon
Copy link
Contributor

bot bench substrate-pallet --pallet=pallet_collective

muraca and others added 10 commits November 10, 2023 15:32
Signed-off-by: muraca <mmuraca247@gmail.com>
…=dev --target_dir=substrate --pallet=pallet_collective
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
Signed-off-by: muraca <mmuraca247@gmail.com>
…=dev --target_dir=substrate --pallet=pallet_collective
Signed-off-by: muraca <mmuraca247@gmail.com>
@muraca muraca requested a review from a team as a code owner March 5, 2024 12:24
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
Signed-off-by: Matteo Muraca <mmuraca247@gmail.com>
@muraca
Copy link
Contributor Author

muraca commented Mar 7, 2024

this needs another benchmark please

@bkchr
Copy link
Member

bkchr commented Mar 11, 2024

CC @ggwpez

@muraca
Copy link
Contributor Author

muraca commented Mar 20, 2024

this needs another benchmark please

please 🥹

prdoc/pr_1445.prdoc Show resolved Hide resolved
pub struct VersionUncheckedMigrateToV5<T, I>(sp_std::marker::PhantomData<(T, I)>);
impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for VersionUncheckedMigrateToV5<T, I> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::TryRuntimeError> {
Copy link
Contributor

Choose a reason for hiding this comment

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

doc?

let mut weight = Weight::zero();

// ProposalOf
for (hash, proposal) in old::ProposalOf::<T, I>::drain() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably need to make this a multi-block migration.

old_proposals.len() as u32 == crate::Voting::<T, I>::count(),
"the number of proposals should be the same",
);
for old in old_proposals {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we also check that the state of each new proposal is correct (relative to the old proposal state)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Proposal is saved in a key-value store, where the key is the hash of the value, and is being migrated to Preimages.

We are moving the content here

for (hash, proposal) in old::ProposalOf::<T, I>::drain() {

did you mean that I should do an integrity check on the content in the post-upgrade check as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, post_upgrade should check every piece of data migrated against the pre-upgrade data and ensure it's in the correct

@ggwpez
Copy link
Member

ggwpez commented Apr 2, 2024

bot bench substrate-pallet --pallet=pallet_collective

sry did not see the notifications.

@command-bot
Copy link

command-bot bot commented Apr 2, 2024

@ggwpez https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5738413 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 4-6b32f3ea-db60-4b12-b826-6997d4b2d743 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Apr 2, 2024

@ggwpez 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/5738413 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5738413/artifacts/download.

@ggwpez
Copy link
Member

ggwpez commented Apr 2, 2024

Benchmarks dont compile... weird error: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/5738413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T2-pallets This PR/Issue is related to a particular pallet.
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Collective pallet - remove without_storage_info
6 participants