Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Adds stake-tracker pallet #14620

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ members = [
"frame/session",
"frame/session/benchmarking",
"frame/society",
"frame/stake-tracker",
"frame/staking",
"frame/staking/reward-curve",
"frame/staking/reward-fn",
Expand Down
61 changes: 61 additions & 0 deletions frame/stake-tracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[package]
name = "pallet-stake-tracker"
version = "0.1.0"
description = "FRAME stake tracker pallet"
authors = ["Parity Technologies <[email protected]>"]
homepage = "https://substrate.io"
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/paritytech/substrate"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [ "derive"] }
scale-info = { version = "2.0.0", default-features = false, features = ["derive"] }

sp-runtime = { version = "24.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] }
sp-staking = { version = "4.0.0-dev", default-features = false, path = "../../primitives/staking", features = ["serde"] }
sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }

sp-npos-elections = { version = "4.0.0-dev", path = "../../primitives/npos-elections" }
frame-election-provider-support = { version = "4.0.0-dev", default-features = false, path = "../election-provider-support" }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, path = "../benchmarking" }
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support"}
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }

[dev-dependencies]
sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }
sp-core = { version = "21.0.0", path = "../../primitives/core" }
sp-io = { version = "23.0.0", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "24.0.0", default-features = false, path = "../../primitives/runtime", features = ["serde"] }
sp-tracing = { version = "10.0.0", path = "../../primitives/tracing" }
pallet-bags-list = { version = "4.0.0-dev", path = "../bags-list" }
pallet-balances = { version = "4.0.0-dev", path = "../balances" }

[features]
default = ["std"]

std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
]

runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]

try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
]
9 changes: 9 additions & 0 deletions frame/stake-tracker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Pallet `stake-tracker`

The stake-tracker pallet is listens to staking events through implemeting the
[`OnStakingUpdate`] trait and forwards those events to one or multiple types (e.g. pallets) that
must be kept up to date with certain updates in staking. The pallet does not expose any
callables and acts as a multiplexer of staking events.

Currently, the stake tracker pallet is used to update the semi-sorted target and voter lists
implemented through bags lists.
Loading