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

Add a "Wish for Change" Track #4

Closed
wants to merge 7 commits into from
Closed

Conversation

Bullrich
Copy link

@Bullrich Bullrich commented Feb 23, 2024

Posting this PR for discussion, but perhaps people have other solutions in mind.

The Root track was designed to handle only one referendum at a time, because calls requiring Root are usually sensitive and should be evaluated one at a time. However, we have also used the Root track to make remarks to signal desires/wishes of the network to various bodies in the network (e.g. RFC-12, instructing the Fellowship to add a collective).

These statements do not execute any stateful logic that would affect the network, and in my opinion more than one could be evaluated at a time. These referenda should not hold up voting on proposals that actually do require Root, nor be forced to queue (for example, it should be possible to propose two new collectives in parallel).

The approval/support requirements are the same as Root, but the origin does not map to any privilege. Passing something on the track is merely a signal.

Copied from polkadot-fellows#184

Summary by CodeRabbit

  • New Features

    • Introduced a new governance track named "Wish for Change" to enable community-driven network changes.
    • Enhanced the parachains runtime API to version 9 on Kusama, incorporating the node_features function for improved network capabilities.
  • Refactor

    • Updated governance origins to include a new WishForChange origin, facilitating the signaling of network preferences and changes.
  • Documentation

    • Updated the CHANGELOG to reflect the addition of the "Wish for Change" track and the update to parachains runtime API.

joepetrowski and others added 7 commits February 14, 2024 08:37
<!-- Remember that you can run `/merge` to enable auto-merge in the PR
-->

<!-- Remember to modify the changelog. If you don't need to modify it,
you can check the following box.
Instead, if you have already modified it, simply delete the following
line. -->

Will be needed for enabling the fix for
paritytech/polkadot-sdk#3144 (unbricking
paraids which acquire multiple cores via coretime). Will also be needed
in the future for enabling other features, like
paritytech/polkadot-sdk#1644 and
paritytech/polkadot-sdk#628

---------

Signed-off-by: alindima <alin@parity.io>
Co-authored-by: Bastian Köcher <git@kchr.de>
Copy link

coderabbitai bot commented Feb 23, 2024

Walkthrough

The recent updates introduce a new "Wish for Change" track across the Kusama and Polkadot networks, enhancing governance mechanisms. Additionally, the parachains runtime API has been upgraded to version 9 in Kusama, enabling the node_features function. This marks a significant step towards more dynamic and responsive network governance, allowing for community-driven changes and preferences to be more effectively signaled and implemented.

Changes

File Path Change Summary
CHANGELOG.md Introduced "Wish for Change" track; Updated parachains runtime API to v9 in Kusama.
integration-tests/.../chains/src/lib.rs Updated api_version from 8 to 9 in Kusama struct.
relay/kusama/src/governance/origins.rs
relay/polkadot/src/governance/origins.rs
Added new WishForChange origin in governance modules.
relay/kusama/src/governance/tracks.rs
relay/polkadot/src/governance/tracks.rs
Added "wish_for_change" track with parameters and new WishForChange origin.
relay/kusama/src/lib.rs Imported vstaging::NodeFeatures, updated to #[api_version(9)], added node_features() function.

🌟🐰✨

In the realm of code, where changes weave,

A new wish sprouts, for change we heave.

Tracks of governance, in light, conceive,

With each version bump, in progress, we believe.

🌈💫🐾

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@paritytech-stg paritytech-stg deleted a comment from cla-bot-2021-stg bot Feb 23, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 959b830 and ebe666e.
Files selected for processing (7)
  • CHANGELOG.md (2 hunks)
  • integration-tests/emulated/chains/src/lib.rs (1 hunks)
  • relay/kusama/src/governance/origins.rs (2 hunks)
  • relay/kusama/src/governance/tracks.rs (3 hunks)
  • relay/kusama/src/lib.rs (3 hunks)
  • relay/polkadot/src/governance/origins.rs (2 hunks)
  • relay/polkadot/src/governance/tracks.rs (3 hunks)
Additional comments: 12
relay/polkadot/src/governance/origins.rs (2)
  • 64-65: The addition of the WishForChange origin is correctly implemented and follows the existing codebase's patterns. Ensure that its integration with the broader governance framework is thoroughly audited to prevent unintended behaviors or security vulnerabilities.
  • 108-108: The inclusion of WishForChange in the decl_unit_ensures! macro is correctly implemented. It's crucial to conduct thorough testing and auditing to ensure its seamless integration with the governance framework.
relay/kusama/src/governance/origins.rs (2)
  • 89-90: The addition of the WishForChange origin for Kusama is correctly implemented and follows the existing codebase's patterns. Ensure that its integration with the broader governance framework is thoroughly audited to prevent unintended behaviors or security vulnerabilities.
  • 133-133: The inclusion of WishForChange in the decl_unit_ensures! macro for Kusama is correctly implemented. It's crucial to conduct thorough testing and auditing to ensure its seamless integration with the governance framework.
CHANGELOG.md (2)
  • 15-15: The documentation of the new "Wish for Change" track in the changelog is clear and concise. Ensure that the documentation remains up to date with any further developments or adjustments to this feature.
  • 24-24: The documentation of the bump in parachains runtime API to v9 in Kusama is clear and informative. It's important to provide detailed documentation for such critical updates to ensure developers and users fully understand the changes and their implications.
relay/polkadot/src/governance/tracks.rs (2)
  • 97-110: The addition of the "wish_for_change" track with an ID of 2 introduces a new governance mechanism. It's crucial to ensure that the parameters set for this track, such as max_deciding, decision_deposit, prepare_period, decision_period, confirm_period, min_enactment_period, min_approval, and min_support, align with the intended governance dynamics for non-state-altering referenda. Given that min_approval and min_support are reused from the APP_ROOT and SUP_ROOT, confirm that this reuse accurately reflects the governance intentions for "wish_for_change" referenda, as these parameters are critical for the decision-making process.
  • 311-311: The handling of the new WishForChange origin with an ID of 2 in the track_for function correctly maps the custom origin to the newly introduced track. This is essential for the governance framework to recognize and process referenda submitted under the "wish_for_change" track. Ensure that all other governance components and modules that interact with governance tracks are updated to recognize and appropriately handle this new origin.
Verification successful

The search results confirm that the WishForChange origin has been integrated into the governance framework of both Polkadot and Kusama. It is recognized as a valid origin within the origins.rs files and is explicitly handled in the tracks.rs files, where it is assigned an ID of 2. Furthermore, the presence of track_for function implementations across various governance components suggests that these parts of the system are designed to work with governance tracks, including the new WishForChange origin. This verifies the integration of the WishForChange origin with other governance components as intended.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that other governance components recognize the new WishForChange origin.
# This script is a placeholder for the actual verification commands that would be needed.
echo "Verify integration with other governance components for WishForChange origin."

Length of output: 164



Script:

#!/bin/bash
# Search for references to WishForChange in the codebase to verify its integration with governance components.
rg "WishForChange" --context 2
# Additionally, search for general governance track handling to see if there's explicit handling of the new origin.
rg "track_for" --context 2

Length of output: 3641

relay/kusama/src/governance/tracks.rs (2)
  • 97-110: The addition of the "wish_for_change" track for Kusama follows the same pattern as in Polkadot, with adjustments to parameters like decision_period to reflect Kusama's faster governance cycle. It's important to ensure that these parameter values, including max_deciding, decision_deposit, prepare_period, confirm_period, min_enactment_period, min_approval, and min_support, are tailored to Kusama's governance needs and expectations. The reuse of APP_ROOT and SUP_ROOT for min_approval and min_support should be specifically validated to ensure it aligns with the governance intentions for "wish_for_change" referenda on Kusama.
  • 311-311: The handling of the WishForChange origin with an ID of 2 in Kusama's track_for function is consistent with the implementation in Polkadot. This consistency is key for maintaining parallel governance mechanisms across both networks. As with Polkadot, ensure that all other governance components and modules in Kusama that interact with governance tracks are updated to recognize and appropriately handle this new origin.
integration-tests/emulated/chains/src/lib.rs (1)
  • 59-59: The update of the api_version from 8 to 9 for the Kusama struct is noted. It's crucial to ensure that this version change is compatible with all parts of the codebase that interact with the Kusama relay chain. Additionally, it may be necessary to update integration tests and documentation to reflect this change.
relay/kusama/src/lib.rs (1)
  • 1972-1974: The addition of the node_features() function to the ParachainHost runtime API is a significant enhancement. It's crucial to ensure that the implementation in parachains_vstaging_api_impl::node_features::<Runtime>() is efficient, secure, and follows best practices. Additionally, verify that this new API function does not introduce any breaking changes or incompatibilities with existing runtime logic.

@Bullrich Bullrich closed this Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants