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

Implementation of ah-client and rc-client staking pallets #7582

Merged
merged 34 commits into from
Feb 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
a92d46b
Initial code for `ah-client` and `rc-client`
tdimitrov Jan 28, 2025
8987573
Fix some compilation errors
tdimitrov Jan 28, 2025
3d6854f
More boilerplate code
tdimitrov Jan 29, 2025
4e2fc90
Send XCM in `ah-client` - initial code
tdimitrov Feb 3, 2025
a3d8e18
Add `pallet-staking-ah-client` to Westend
tdimitrov Feb 4, 2025
c8abe2a
XCM sending - converting `T::AccountId` to `AccountId32` is ugly but …
tdimitrov Feb 5, 2025
1d0d9e0
`ensure_root_or_para` for `new_validators` call
tdimitrov Feb 5, 2025
0c5c341
Improvements, comments and fixes for compilation warnings
tdimitrov Feb 5, 2025
ef6afad
Use `None` for `fallback_max_weight`
tdimitrov Feb 6, 2025
d86b74b
`pallet-staking-rc-client` - initial commit
tdimitrov Feb 10, 2025
45b9820
`pallet-staking-rc-client` - xcm
tdimitrov Feb 10, 2025
cda24d0
typo
tdimitrov Feb 12, 2025
7106211
Add a placeholder for triggering an election in staking pallet
tdimitrov Feb 12, 2025
55d2660
Undo Westend changes
tdimitrov Feb 13, 2025
56929b1
Update comments in `ah-client`
tdimitrov Feb 13, 2025
c3ae3a3
`StakingApi` trait in `pallet-staking-rc-client`
tdimitrov Feb 13, 2025
a7f11c0
Update from tdimitrov running command 'prdoc'
github-actions[bot] Feb 14, 2025
c4a09b8
Fix a clippy warning
tdimitrov Feb 14, 2025
2ca6a3a
Update PR doc
tdimitrov Feb 14, 2025
c1360d9
taplo format
tdimitrov Feb 14, 2025
8e58760
check-umbrella
tdimitrov Feb 14, 2025
d0954df
taplo format
tdimitrov Feb 14, 2025
d63d4c2
small cleanup
tdimitrov Feb 14, 2025
2c41113
Fix `ah-client` Cargo file
tdimitrov Feb 14, 2025
236421c
clippy
tdimitrov Feb 14, 2025
6031af7
publish = false
tdimitrov Feb 14, 2025
a1c9331
Code review feedback
tdimitrov Feb 15, 2025
9251c39
rename pr doc
tdimitrov Feb 15, 2025
d9c57e9
Undo `publish = false` because the crates are a dependency of `pallet…
tdimitrov Feb 15, 2025
4cab46b
compilation error
tdimitrov Feb 15, 2025
a295a0c
Remove a `todo!` causing `six_session_delay` test to fail
tdimitrov Feb 15, 2025
49d7022
Merge branch 'master' into tsv-ahm-staking-pallets
tdimitrov Feb 16, 2025
443ecd6
Merge branch 'master' into tsv-ahm-staking-pallets
tdimitrov Feb 17, 2025
3af0e55
Merge branch 'master' into tsv-ahm-staking-pallets
Ank4n Feb 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ members = [
"substrate/frame/session/benchmarking",
"substrate/frame/society",
"substrate/frame/staking",
"substrate/frame/staking/ah-client",
"substrate/frame/staking/rc-client",
"substrate/frame/staking/reward-curve",
"substrate/frame/staking/reward-fn",
"substrate/frame/staking/runtime-api",
Expand Down Expand Up @@ -998,6 +1000,8 @@ pallet-session-benchmarking = { path = "substrate/frame/session/benchmarking", d
pallet-skip-feeless-payment = { path = "substrate/frame/transaction-payment/skip-feeless-payment", default-features = false }
pallet-society = { path = "substrate/frame/society", default-features = false }
pallet-staking = { path = "substrate/frame/staking", default-features = false }
pallet-staking-ah-client = { path = "substrate/frame/staking/ah-client", default-features = false }
pallet-staking-rc-client = { path = "substrate/frame/staking/rc-client", default-features = false }
pallet-staking-reward-curve = { path = "substrate/frame/staking/reward-curve", default-features = false }
pallet-staking-reward-fn = { path = "substrate/frame/staking/reward-fn", default-features = false }
pallet-staking-runtime-api = { path = "substrate/frame/staking/runtime-api", default-features = false }
Expand Down
17 changes: 17 additions & 0 deletions prdoc/pr_7582.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
title: Implementation of `ah-client` and `rc-client` staking pallets
doc:
- audience: Runtime Dev
description: |-
This PR introduces the initial structure for `pallet-ah-client` and `pallet-rc-client`. These
pallets will reside on the relay chain and AssetHub, respectively, and will manage the interaction
between `pallet-session` on the relay chain and `pallet-staking` on AssetHub.
Both pallets are experimental and not intended for production use.
crates:
- name: pallet-staking-ah-client
bump: major
- name: pallet-staking-rc-client
bump: major
- name: pallet-election-provider-multi-block
bump: minor
- name: pallet-staking
bump: major
2 changes: 1 addition & 1 deletion substrate/frame/election-provider-multi-block/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
//!
//! ## Pagination
//!
//! Most of the external APIs of this pallet are paginated. All pagination follow a patter where if
//! Most of the external APIs of this pallet are paginated. All pagination follow a pattern where if
//! `N` pages exist, the first paginated call is `function(N-1)` and the last one is `function(0)`.
//! For example, with 3 pages, the `elect` of [`ElectionProvider`] is expected to be called as
//! `elect(2) -> elect(1) -> elect(0)`. In essence, calling a paginated function with index 0 is
Expand Down
66 changes: 66 additions & 0 deletions substrate/frame/staking/ah-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
[package]
name = "pallet-staking-ah-client"
description = "Pallet handling the communication with staking-rc-client. It's role is to glue the staking pallet (on AssetHub chain) and session pallet (on Relay Chain) in a transparent way."
license = "Apache-2.0"
version = "0.1.0"
edition.workspace = true
authors.workspace = true
repository.workspace = true

[dependencies]
codec = { workspace = true, features = ["derive"] }
frame-support = { workspace = true }
frame-system = { workspace = true }
log = { workspace = true }
pallet-authorship = { workspace = true }
pallet-session = { features = ["historical"], workspace = true }
pallet-staking = { workspace = true }
pallet-staking-rc-client = { workspace = true }
polkadot-primitives = { workspace = true }
polkadot-runtime-parachains = { workspace = true }
scale-info = { workspace = true, features = ["derive"] }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
sp-staking = { workspace = true }
xcm = { workspace = true }

[features]
default = ["std"]
std = [
"codec/std",
"frame-support/std",
"frame-system/std",
"log/std",
"pallet-authorship/std",
"pallet-session/std",
"pallet-staking-rc-client/std",
"pallet-staking/std",
"polkadot-primitives/std",
"polkadot-runtime-parachains/std",
"scale-info/std",
"sp-core/std",
"sp-runtime/std",
"sp-staking/std",
"xcm/std",
]
runtime-benchmarks = [
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-staking-rc-client/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"polkadot-runtime-parachains/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
"xcm/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"pallet-authorship/try-runtime",
"pallet-session/try-runtime",
"pallet-staking-rc-client/try-runtime",
"pallet-staking/try-runtime",
"polkadot-runtime-parachains/try-runtime",
"sp-runtime/try-runtime",
]
Loading
Loading