Polkadot SDK

repository·master·Indexed 25 days ago

https://github.com/paritytech/polkadot-sdk

A collection of components for building on the Polkadot multi-chain blockchain platform, including Substrate, FRAME, Cumulus, and XCM. The SDK provides specialized bridge modules such as the Bridge GRANDPA pallet for finality gadget light clients, the Bridge Messages Pallet for unidirectional cross-chain communication, and the Bridge Parachains Pallet for tracking finalized parachain heads.

Tokens
221.5K
Snippets
336
Records
1.2K
Agent score
84%

What's inside polkadot-sdk

  1. Overview of the Tipping Pallet (pallet-tips)

    master

    The pallet-tips subsystem enables an agile tipping process where rewards are distributed from the treasury to a beneficiary based on community declarations.

    Key Mechanism:

    1. A group of Tippers is defined via the Config trait.
    2. Once half of the configured tippers have declared an amount for a specific Tip Reason, a countdown period begins.
    3. Remaining members can declare their tip amounts during this countdown.
    4. Upon closing, the median of all declared tips is paid to the beneficiary, plus any applicable Finders Fee if the original report was public and bonded.

    Note: This pallet is tightly coupled to pallet-treasury.

  2. Overview of Availability Subsystems

    master

    Availability subsystems ensure that Proofs of Validity (PoV) for backed candidates are widely distributed across the validator set. This allows for verification without requiring every node to store a full copy of the PoV.

    Key responsibilities include:

    • Erasure-coded distribution: Broadly distributing erasure-coded chunks of the PoV.
    • Chunk tracking: Using signed bitfields to track which validators hold specific chunks.
    • PoV Reassembly: Reassembling a complete PoV when necessary, such as when an approval checker needs to validate a parachain block.
  3. Overview of the Child Bounties Pallet

    master

    The pallet-child-bounties pallet allows large bounty proposals to be divided into smaller, manageable chunks (child bounties) for parallel execution and efficient governance. This enables breaking down a large task into smaller pieces of work extracted from a parent bounty.

    Key Concepts:

    • Parent Bounty: The original large bounty proposal.
    • Child Bounty: A smaller piece of work extracted from a parent bounty.
    • Curator: An account assigned by the parent bounty curator to manage the child bounty and assign payout addresses once tasks are completed.

    Note: This pallet is tightly coupled with pallet-treasury and pallet-bounties.

  4. Overview of the Treasury Pallet

    master

    The Treasury pallet manages a central 'pot' of funds and provides a governance structure for stakeholders to propose, approve, and deny expenditures. To function, the chain must implement a mechanism (such as inflation or transaction fees) to collect funds into the treasury pot.

    Key Terminology

    • Proposal: A suggestion to allocate funds from the pot to a specific beneficiary.
    • Beneficiary: The account designated to receive funds if a proposal is approved.
    • Deposit: Funds locked by a proposer during the proposal process. This deposit is returned if the proposal is approved or slashed if the proposal is rejected.
    • Pot: The accumulated unspent funds within the treasury pallet.
  5. Overview of Approval Subsystems

    master

    The Approval Subsystems implement the node-side logic for the Approval Protocol. The system is divided into two primary functional areas:

    1. Assignment/Voting Logic: Handles the core logic for assigning and voting.
    2. Distribution Logic: Responsible for distributing assignment certifications and approval votes.

    These subsystems are designed to flag issues, initiate participation in live disputes, and track all observed votes (including backing, approval, and dispute-specific votes) by all validators on all candidates. The assignment and voting logic also informs the GRANDPA voting rule regarding how to vote.

  6. Overview of the Democracy Pallet

    master

    The Democracy pallet manages general stakeholder voting for the chain. It handles the lifecycle of proposals from submission to enactment through a referendum process.

    Key Concepts

    • Proposal Queues: Proposals enter either a proposal queue (public proposals) or an external queue (proposals from external origins like collective groups).
    • Referendums: Periodically, the pallet launches a referendum from the queues. Any token holder can vote on these.
    • Voting & Conviction: Voting uses a time-lock mechanism. Voters set a conviction, which determines both the duration tokens are locked and the multiplier applied to their voting power.
    • Adaptive Quorum Biasing: Referendums can use biasing to adjust passing thresholds based on turnout:
      • Positive turnout bias: Requires a super-majority to pass; the threshold decreases as turnout increases. These are rejected by default.
      • Negative turnout bias: Requires a super-majority to reject; the threshold decreases as turnout increases. These are passed by default.
    • Delegation: Users can grant their voting power (tokens * conviction) to another account.