merge v1 into main (#175)

* Add zombienet config to release (#158)

* Cleanup docs for the release (#160)

* Updated documentation to version 1.7.0
* Updated broken links

* updated docs to v1.10 (#166)

* updated dependencies to v1.10.0 (#165)

* Fixed weights for non-XCM related pallets (#149)

* add remove proxies to filter (#146)

* Fix weights for XCM and Message Queue.  (#153)

* Fix for PriceForSiblingDelivery (#156)

* Fix the FeeManager setting (#159)

* better explanation for constants (#167)

* better explanation for constants

* Removed polkadot launch (#169)

* Removed warnings about experimental code. (#170)

* Attached audit.

* toml sort

* changelog and version bump (#174)

* changelog and version bump

* cargo fmt fix

---------

Co-authored-by: Nikita Khateev <nikita.khateev@openzeppelin.com>
Co-authored-by: Amar Singh <asinghchrony@protonmail.com>
This commit is contained in:
Özgün Özerk
2024-04-29 11:06:24 +03:00
committed by GitHub
parent 26778e090f
commit 30930edda5
43 changed files with 4318 additions and 1462 deletions
@@ -4,13 +4,15 @@
= collator_selection
Branch/Release: `release-polkadot-v1.3.0`
Branch/Release: `release-polkadot-v1.10.0`
== Source Code link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.10.0/cumulus/pallets/collator-selection/src/lib.rs[{github-icon},role=heading-link]
== Purpose
This pallet is needed to manage the set of xref:glossary.adoc#collator[collators] for each session and to provision the next session with the actual list of collators.
== Config link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/cumulus/pallets/collator-selection/src/lib.rs#L118[{github-icon},role=heading-link]
== Config
* Pallet-specific configs
** `UpdateOrigin` — defines the list of origins that are able to modify the settings of collators (e.g. set and remove list of xref:glossary.adoc#invulnerable[invulnerables], desired xref:glossary.adoc#candidates[candidates], xref:glossary.adoc#candidacy_bond[candidacy bond]). This type should implement the trait `EnsureOrigin`.
@@ -27,7 +29,7 @@ This pallet is needed to manage the set of xref:glossary.adoc#collator[collators
** `Currency`
** `WeightInfo`
== Dispatchables link:https://github.com/paritytech/polkadot-sdk/blob/release-polkadot-v1.3.0/cumulus/pallets/collator-selection/src/lib.rs#L301[{github-icon},role=heading-link]
== Dispatchables
[.contract-item]
[[set_invulnerables]]
@@ -36,7 +38,7 @@ This pallet is needed to manage the set of xref:glossary.adoc#collator[collators
----
pub fn set_invulnerables(new: Vec<T::AccountId>)
----
Sets a new list of invulnerable collators. The call must be signed and origin of the call must fulfill the EnsureOrigin check.
Sets a new list of invulnerable collators. The call must be signed and origin of the call must fulfill the EnsureOrigin check.
IMPORTANT: This call does not maintain the mutual exclusiveness of candidates and invulnerables lists.
@@ -83,7 +85,7 @@ Set a new maximum possible number of candidates. If it is higher than `Config::M
----
pub fn set_candidacy_bond(max: u32)
----
Set the amount for the deposit to be a candidate for collator.
Set the amount for the deposit to be a candidate for collator.
**Params:**
@@ -186,4 +188,68 @@ Remove an invulnerable from the list. Call must be signed and caller pass `Confi
**Events:**
- `InvulnerableRemoved(account_id)`
- `InvulnerableRemoved(account_id)`
[.contract-item]
[[update_bond]]
==== `[.contract-item-name]#++update_bond++#`
[source,rust]
----
pub fn update_bond(new_deposit: BalanceOf<T>)
----
Update the candidacy bond of origin to the new value.
*Params:*
- `new_deposit: BalanceOf<T>` — new value for the candidacy bond
**Errors:**
- `BadOrigin` — callers origin does not fulfill the `Config::EnsureOrigin` check.
- `DepositTooLow` - new deposit is smaller than required candidacy bond.
- `NotCandidate` - caller's origin is not a candidate
- `IdenticalDeposit` - deposit have not changed
- `InsufficientBalance` — candidate does not have enough funds for deposit for candidacy bond
- `LiquidityRestrictions` — account restrictions (like frozen funds or vesting) prevent from creating a deposit
- `Overflow` — reserved funds overflow the currency type. Should not happen in usual scenarios.
- `InvalidUnreserve` - after the unreserve the number of candidates becomes less than desired.
- `InsertToCandidateListFailed` - candidate list is at maximum capacity. Should not happen in usual scenarios. Chain is misconfigured.
**Events:**
- `CandidateBondUpdated(account_id, deposit)`
[.contract-item]
[[take_candidate_slot]]
==== `[.contract-item-name]#++take_candidate_slot++#`
[source,rust]
----
pub fn take_candidate_slot(
deposit: BalanceOf<T>,
target: T::AccountId,
)
----
Try to replace the target's candidacy by making a bigger candidacy bond.
*Params:*
- `deposit: BalanceOf<T>` — value for the candidacy bond
- `target: T::AccountId` - target candidate to replace
**Errors:**
- `BadOrigin` — callers origin does not fulfill the `Config::EnsureOrigin` check.
- `AlreadyInvulnerable` — caller is already in invulnerable collators list.
- `InsufficientBond` - the deposit is less the candidacy bond or target's deposit.
- `NoAssociatedValidatorId` — caller does not have a session key.
- `ValidatorNotRegistered` — caller session key is not registered.
- `AlreadyCandidate` — caller is already in candidates list.
- `TargetIsNotCandidate` - target is not in candidate list.
- `InsufficientBalance` — candidate does not have enough funds for deposit for candidacy bond
- `LiquidityRestrictions` — account restrictions (like frozen funds or vesting) prevent from creating a deposit
- `Overflow` — reserved funds overflow the currency type. Should not happen in usual scenarios.
**Events:**
- `CandidateReplaced(old, new, deposit)`