-
Notifications
You must be signed in to change notification settings - Fork 72
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
feat: impl block rewards #1198
feat: impl block rewards #1198
Changes from 68 commits
b9bd2c4
a69bb5e
a2f9a79
1c81915
c4dbe47
795036d
664eee6
020ec78
ccae5c6
a99a583
1ee21af
257308d
bdb6d12
97292e2
4c48350
6fa7c4a
0d73cf3
a5ac903
910139a
8b8c40f
c5340dd
70bcdc9
4ad2bb0
ce7d9d2
e94c1d0
df29f21
9ccc965
00fb722
6ecd801
12a1f6f
70b46bb
6a23f9a
95770df
bce628a
8aad4b0
c03962a
b21e10a
2de4fb6
48fd15e
0a5c366
6971b5a
17b6c67
69f703c
cec502e
f8044e5
55b0272
373a5ed
1d3da74
34a7c57
60194a9
404e564
144ed20
c1304aa
78deabb
5556b2c
5597f73
fdcd632
5f84538
7070475
43f6127
7d4251c
19fb92a
dd50f66
b2cbf25
ae05055
b936c39
d5a4f1a
93a481c
684dc68
3f44316
cb72de4
7c64b8d
27e4653
7223a31
02060eb
5be160c
ecd49de
8650cc8
69de861
97a0dbe
5a3a6ad
572d9e2
cbb10b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ case $TARGET in | |
;; | ||
|
||
integration) | ||
RUST_MIN_STACK=8388608 cargo test --release --package runtime-integration-tests | ||
RUST_MIN_STACK=8388608 cargo test --release --package runtime-integration-tests --features fast-runtime | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Required for newly added |
||
;; | ||
|
||
fmt) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,10 @@ pub const STAKE_POT_PALLET_ID: PalletId = PalletId(*b"PotStake"); | |
// Other ids | ||
pub const CHAIN_BRIDGE_HASH_ID: [u8; 13] = *b"cent_nft_hash"; | ||
pub const CHAIN_BRIDGE_NATIVE_TOKEN_ID: [u8; 4] = *b"xCFG"; | ||
|
||
// Reward related | ||
/// The identifier of the group eligible to receive block rewards. | ||
pub const COLLATOR_GROUP_ID: u32 = 1; | ||
/// The default amount of stake for CurrencyId::Staking(StakingCurrency::BlockRewards) which is inherently | ||
/// assigned to any member of the only group in block rewards. | ||
pub const DEFAULT_COLLATOR_STAKE: u32 = 1000; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a symbolic amount, but might make sense to have as the same u128 as all the amounts that we deal with, and possibly do keep the units we expect: 1 * CFG. I think the current value is below the ExistentialDeposit of 1 MicroCFG. Might not be an issue at the moment, but later on if these amounts become more liquid it could. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Definitely! Done in 3f44316 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
[package] | ||
name = "pallet-block-rewards" | ||
version = "0.1.0" | ||
authors = ["Centrifuge <admin@centrifuge.io>"] | ||
description = "Block Rewards pallet" | ||
edition = "2021" | ||
homepage = "https://centrifuge.io" | ||
license = "LGPL-3.0" | ||
repository = "https://github.com/centrifuge/centrifuge-chain" | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
cfg-primitives = { path = "../../libs/primitives", default-features = false } | ||
cfg-traits = { path = "../../libs/traits", default-features = false } | ||
cfg-types = { path = "../../libs/types", default-features = false } | ||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } | ||
frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32" } | ||
frame-system = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32" } | ||
log = { version = "0.4.17", default-features = false } | ||
mustermeiszer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
num-traits = { version = "0.2", default-features = false } | ||
pallet-collator-selection = { git = "https://github.com/paritytech/cumulus", default-features = false, branch = "polkadot-v0.9.32" } | ||
pallet-session = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32" } | ||
scale-info = { version = "2.3.0", default-features = false, features = ["derive"] } | ||
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32" } | ||
sp-staking = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32" } | ||
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.32" } | ||
|
||
# optional dependencies for benchmarking | ||
frame-benchmarking = { git = "https://github.com/paritytech/substrate", default-features = false, optional = true, branch = "polkadot-v0.9.32" } | ||
|
||
[dev-dependencies] | ||
orml-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.32" } | ||
orml-traits = { git = "https://github.com/open-web3-stack/open-runtime-module-library", branch = "polkadot-v0.9.32" } | ||
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" } | ||
pallet-restricted-tokens = { path = "../restricted-tokens", default-features = false } | ||
pallet-rewards = { path = "../rewards", default-features = false } | ||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" } | ||
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.32" } | ||
|
||
[features] | ||
default = ["std"] | ||
try-runtime = [ | ||
"cfg-primitives/try-runtime", | ||
"cfg-traits/try-runtime", | ||
"frame-support/try-runtime", | ||
"cfg-types/try-runtime", | ||
"frame-system/try-runtime", | ||
"pallet-collator-selection/try-runtime", | ||
"pallet-session/try-runtime", | ||
] | ||
runtime-benchmarks = [ | ||
"frame-benchmarking", | ||
"cfg-traits/runtime-benchmarks", | ||
"cfg-types/runtime-benchmarks", | ||
"frame-support/runtime-benchmarks", | ||
"frame-system/runtime-benchmarks", | ||
"pallet-collator-selection/runtime-benchmarks", | ||
"sp-runtime/runtime-benchmarks", | ||
"sp-staking/runtime-benchmarks", | ||
"cfg-primitives/runtime-benchmarks", | ||
] | ||
std = [ | ||
"frame-benchmarking/std", | ||
"num-traits/std", | ||
"scale-info/std", | ||
"cfg-primitives/std", | ||
"cfg-traits/std", | ||
"cfg-types/std", | ||
"codec/std", | ||
"log/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"pallet-collator-selection/std", | ||
"pallet-rewards/std", | ||
"pallet-session/std", | ||
"sp-runtime/std", | ||
"sp-staking/std", | ||
"sp-std/std", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove
gruberb
from this file since you are touching it? :)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7223a31