Skip to content

Conversation

@ashutoshvarma
Copy link
Contributor

@ashutoshvarma ashutoshvarma commented Sep 9, 2025

Partially resolves #1521

Summary

This PR updates the collator selection mechanism to governance approved system. A candidate applicant needs to apply first by reserving the bond and only once application is approved by governanace the node is added to collator candidates. Also governanace can kick & slash bad performing collator candidates.

The pallet uses two configurable origins for governance actions

  • GovernanceOrigin: Can approve/close candidacy applications
  • ForceRemovalOrigin: Can forcibly kick and slash candidates

The following extrinsincs are added,

  • apply_for_candidacy: Apply to be a candidate by reserving bond
  • close_application: Close pending candidate application, unreserve the bond.
  • approve_application: Approve the candidate application, add node to candidates. (Only GovernanceOrigin)
  • kick_candidate: Kick and slash a candidate immediately. (Only ForceRemovalOrigin)
    • If governance wish to remove a candidate without slashing, it can be done via wrapping the leave_intent call with utility's dispatch_as via a referendum

Note:-

The old register_as_candidate is deprecated and will fail with Permission error (should be removed?)

Configs

For Astar & Shibuya

  • GovernanceOrigin: 2/3 MainCouncil OR Referendum
  • ForceRemovalOrigin: 2/3 MainCouncil OR Referendum

For Shiden, both root account

TODO

  • Finalise the origins config for Astar
  • Astar Docs PR

Check list**

  • added or updated unit tests
  • updated Astar official documentation
  • added benchmarks & weights for any modified runtime logics.

@ashutoshvarma ashutoshvarma added the runtime This PR/Issue is related to the topic “runtime”. label Sep 9, 2025
@ashutoshvarma
Copy link
Contributor Author

/bench astar-dev,shibuya-dev,shiden-dev pallet_collator_selection

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17574770820.
Please wait for a while.
Branch: feat/collator-selection-improvment
SHA: 96219d9

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Benchmark job failed.
Please check https://github.com/AstarNetwork/Astar/actions/runs/17574770820.

@ashutoshvarma
Copy link
Contributor Author

/bench astar,shibuya,shiden pallet_collator_selection

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/17576131975.
Please wait for a while.
Branch: feat/collator-selection-improvment
SHA: 96219d9

@github-actions
Copy link

github-actions bot commented Sep 9, 2025

Benchmarks have been finished.
You can download artifacts if exists https://github.com/AstarNetwork/Astar/actions/runs/17576131975.

@ashutoshvarma
Copy link
Contributor Author

/bench astar-dev,shibuya-dev,shiden-dev pallet_collator_selection

@github-actions
Copy link

Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/18000194658.
Please wait for a while.
Branch: feat/collator-selection-improvment
SHA: 1417c14

@github-actions
Copy link

Benchmark job failed.
Please check https://github.com/AstarNetwork/Astar/actions/runs/18000194658.

@ashutoshvarma
Copy link
Contributor Author

/bench astar,shibuya,shiden pallet_collator_selection

@github-actions
Copy link

Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/18002582024.
Please wait for a while.
Branch: feat/collator-selection-improvment
SHA: 1417c14

@github-actions
Copy link

Benchmarks have been finished.
You can download artifacts if exists https://github.com/AstarNetwork/Astar/actions/runs/18002582024.

@ashutoshvarma ashutoshvarma marked this pull request as ready for review October 1, 2025 02:47
Copy link
Contributor

@PierreOssun PierreOssun left a comment

Choose a reason for hiding this comment

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

Really clean thanks!
I just have 2 questions and one suggestion

Dinonard
Dinonard previously approved these changes Oct 14, 2025
Copy link
Contributor

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

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

LGTM

PierreOssun
PierreOssun previously approved these changes Oct 14, 2025
Copy link
Contributor

@PierreOssun PierreOssun left a comment

Choose a reason for hiding this comment

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

LGTM

@ashutoshvarma ashutoshvarma dismissed stale reviews from PierreOssun and Dinonard via 9bdf533 October 14, 2025 06:38
@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
pallets/price-aggregator/src 75% 0%
pallets/unified-accounts/src 79% 0%
precompiles/sr25519/src 56% 0%
precompiles/dapp-staking/src 89% 0%
precompiles/dapp-staking/src/test 0% 0%
primitives/src 53% 0%
pallets/democracy-mbm/src 30% 0%
precompiles/substrate-ecdsa/src 67% 0%
precompiles/dispatch-lockdrop/src 83% 0%
chain-extensions/pallet-assets/src 54% 0%
pallets/astar-xcm-benchmarks/src/fungible 100% 0%
chain-extensions/types/assets/src 0% 0%
pallets/dapp-staking/src 80% 0%
pallets/static-price-provider/src 91% 0%
pallets/ethereum-checked/src 76% 0%
pallets/inflation/src 58% 0%
pallets/vesting-mbm/src 87% 0%
precompiles/assets-erc20/src 77% 0%
pallets/dapp-staking/rpc/runtime-api/src 0% 0%
pallets/collator-selection/src 88% 0%
pallets/dapp-staking/src/benchmarking 95% 0%
chain-extensions/unified-accounts/src 0% 0%
pallets/collective-proxy/src 94% 0%
primitives/src/xcm 60% 0%
precompiles/unified-accounts/src 100% 0%
pallets/xc-asset-config/src 64% 0%
pallets/astar-xcm-benchmarks/src/generic 100% 0%
chain-extensions/types/unified-accounts/src 0% 0%
pallets/astar-xcm-benchmarks/src 86% 0%
pallets/dapp-staking/src/test 0% 0%
precompiles/xcm/src 69% 0%
pallets/dynamic-evm-base-fee/src 84% 0%
Summary 73% (3888 / 5345) 0% (0 / 0)

Minimum allowed line rate is 50%

@ashutoshvarma ashutoshvarma merged commit ad343db into master Oct 14, 2025
8 checks passed
@ashutoshvarma ashutoshvarma deleted the feat/collator-selection-improvment branch October 14, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

runtime This PR/Issue is related to the topic “runtime”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Meta] Collator Selection Improvement

4 participants