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

Disabled validators runtime API #1257

Merged
merged 13 commits into from
Oct 12, 2023
Merged

Disabled validators runtime API #1257

merged 13 commits into from
Oct 12, 2023

Conversation

tdimitrov
Copy link
Contributor

@tdimitrov tdimitrov commented Aug 29, 2023

Exposes disabled validators list via a runtime API.

@paritytech-cicd-pr
Copy link

The CI pipeline was cancelled due to failure one of the required jobs.
Job name: cargo-clippy
Logs: https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/3716470

Comment on lines 129 to 132
<pallet_session::Pallet<T>>::disabled_validators()
.iter()
.cloned()
.map(|v| ValidatorIndex(v))
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that's correct since the type ValidatorIndex implies shuffling (and currently truncation to max_validators) done in the shared pallet. Session indices are raw.

* master: (61 commits)
  OpenGov in Westend and Rococo (#1177)
  Associated type Hasher for `QueryPreimage`, `StorePreimage` and `Bounded` (#1720)
  Migrate polkadot-primitives to v6 (#1543)
  genesis-builder: implemented for all runtimes (#1492)
  `BlockId` removal: `tx-pool` refactor (#1678)
  Bump directories from 4.0.1 to 5.0.1 (#1656)
  Allow debug_assertions in short-benchmarks CI job (#1711)
  chainHead/storage: Fix storage iteration using the query key (#1665)
  Implement more useful traits in `Slot` type (#1595)
  Make downloads in parallel and give more time to complete (#1699)
  Bump actions/checkout from 4.0.0 to 4.1.0 (#1688)
  contracts: Fix incorrect storage alias in mirgration (#1687)
  Fix documentation about justification and `finalized == true` requirement (#1607)
  tweak pallet macro (genesis_config etc) to cater for RA users as well. (#1689)
  Uncoupling pallet-xcm from frame-system's RuntimeCall (#1684)
  Bump aes-gcm from 0.10.2 to 0.10.3 (#1681)
  docs / Update PR template to reflect monorepo (#1674)
  update contributing guide and ui-tests scripts (#1668)
  pallet epm: add `TrimmingStatus` to the mined solution (#1659)
  Update HRMP pallet benchmarking to use benchmarks v2 (#1676)
  ...
@ordian ordian added the T4-runtime_API This PR/Issue is related to runtime APIs. label Sep 27, 2023
Copy link
Contributor

@BradleyOlson64 BradleyOlson64 left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@tdimitrov tdimitrov changed the title Node side changes for validator disabling Disabled validators runtime API Sep 28, 2023
Copy link
Contributor

@AndreiEres AndreiEres left a comment

Choose a reason for hiding this comment

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

lgtm

&mut self,
relay_parent: &Hash,
) -> Option<&Vec<ValidatorIndex>> {
self.disabled_validators.get(relay_parent).map(|v| &*v)
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, what that .map(|v| &*v) does?

Copy link
Member

Choose a reason for hiding this comment

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

It converts &mut to &

@@ -597,6 +597,14 @@ impl RelayChainRpcClient {
.await
}

pub async fn parachain_host_disabled_validators(
Copy link
Member

Choose a reason for hiding this comment

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

Still not sure why we need to expose everything via RPC. I personally would limit the public facing APIs as much as possible. Anything that is exposed, we need to assume we can not change it without breaking things.

Copy link
Member

Choose a reason for hiding this comment

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

The very least we should communicate clearly that these RPC calls are an unstable feature, which might change anytime.

Copy link
Member

Choose a reason for hiding this comment

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

paritytech/cumulus#2160 (comment)

Well, I agree we should limit the scope for collators. But this is out of scope (hehe) of this PR.

* master: (24 commits)
  Init System Parachain storage versions and add migration check jobs to CI (#1344)
  no-bound derives: Use absolute path for `core` (#1763)
  migrate alliance, fast-unstake and bags list to use derive-impl (#1636)
  Tvl pool staking (#1322)
  improve service error (#1734)
  frame-support: `RuntimeDebug\Eq\PartialEq` impls for `Imbalance` (#1717)
  Point documentation links to monorepo (#1741)
  [NPoS] Fix for Reward Deficit in the pool (#1255)
  Move import queue from `ChainSync` to `SyncingEngine` (#1736)
  Enable mocking contracts (#1331)
  Revert "fix(review-bot): pull secrets from `master` environment" (#1748)
  Remove kusama and polkadot runtime crates (#1731)
  Use `Extensions` to register offchain worker custom extensions (#1719)
  [RPC-Spec-V2] chainHead: use integer for block index and adjust RuntimeVersion JSON format (#1666)
  fix(review-bot): pull secrets from `master` environment (#1745)
  Fix `subkey inspect` output text padding (#1744)
  archive: Implement height, hashByHeight and call (#1582)
  rpc/client: Propagate `rpc_methods` method to reported methods (#1713)
  rococo-runtime: `RococoGenesisExt` removed (#1490)
  PVF: more filesystem sandboxing (#1373)
  ...
@tdimitrov tdimitrov marked this pull request as ready for review October 9, 2023 09:11
@tdimitrov
Copy link
Contributor Author

@eskimor @ordian should we merge this?

@ordian
Copy link
Member

ordian commented Oct 9, 2023

no objection from me

@ordian ordian merged commit 7aace06 into master Oct 12, 2023
100 of 102 checks passed
@ordian ordian deleted the tsv-disabling-node-side branch October 12, 2023 13:01
ordian added a commit that referenced this pull request Oct 16, 2023
* master: (54 commits)
  Publish `xcm-emulator` crate (#1881)
  Adding migrations to clean Rococo Gov 1 storage & reserved funds (#1849)
  Arkworks Elliptic Curve utils overhaul (#1870)
  Fix typos (#1878)
  fix: GoAhead signal only set when runtime upgrade is enacted from parachain side (#1176)
  Refactor staking ledger (#1484)
  Paired-key Crypto Scheme (#1705)
  Include polkadot version in artifact path (#1828)
  add link to rfc-0001 in broker README (#1862)
  Discard `Executor` (#1855)
  Macros to use path instead of ident (#1474)
  Remove clippy clone-double-ref lint noise (#1860)
  Refactor alliance benchmarks to v2 (#1868)
  Check executor params coherence (#1774)
  frame: use derive-impl for beefy and mmr pallets (#1867)
  sc-consensus-beefy: improve gossip logic (#1852)
  Adds instance support for composite enums (#1857)
  Fix links to implementers' guide (#1865)
  Disabled validators runtime API (#1257)
  Adding `try_state` hook for `Treasury` pallet (#1820)
  ...
ordian added a commit that referenced this pull request Oct 16, 2023
…ribution

* tsv-disabling-backing: (54 commits)
  Publish `xcm-emulator` crate (#1881)
  Adding migrations to clean Rococo Gov 1 storage & reserved funds (#1849)
  Arkworks Elliptic Curve utils overhaul (#1870)
  Fix typos (#1878)
  fix: GoAhead signal only set when runtime upgrade is enacted from parachain side (#1176)
  Refactor staking ledger (#1484)
  Paired-key Crypto Scheme (#1705)
  Include polkadot version in artifact path (#1828)
  add link to rfc-0001 in broker README (#1862)
  Discard `Executor` (#1855)
  Macros to use path instead of ident (#1474)
  Remove clippy clone-double-ref lint noise (#1860)
  Refactor alliance benchmarks to v2 (#1868)
  Check executor params coherence (#1774)
  frame: use derive-impl for beefy and mmr pallets (#1867)
  sc-consensus-beefy: improve gossip logic (#1852)
  Adds instance support for composite enums (#1857)
  Fix links to implementers' guide (#1865)
  Disabled validators runtime API (#1257)
  Adding `try_state` hook for `Treasury` pallet (#1820)
  ...
@Overkillus Overkillus linked an issue Jan 17, 2024 that may be closed by this pull request
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 8, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 9, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
serban300 pushed a commit to serban300/polkadot-sdk that referenced this pull request Apr 10, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
bkchr pushed a commit that referenced this pull request Apr 10, 2024
* merge all similar update_conversion_rate functions

* stall timeout in conversion rate update loop

* fmt

* fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T4-runtime_API This PR/Issue is related to runtime APIs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabled Validators Runtime API
6 participants