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

[encointer] introduce collator selection and send fees to authors instead of treasury #270

Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8ad5ba5
3 new pallets for collator selection. copy-paste from AH
brenzi Apr 9, 2024
8715796
remove DMP queue pallet
brenzi Apr 9, 2024
f70d07d
add encointer invulnerables for testnet genesis
brenzi Apr 9, 2024
5e81b71
remove treasury pallet and grant fees to collator pot instead
brenzi Apr 10, 2024
0748d86
send fees in CC to block author
brenzi Apr 10, 2024
d8f179c
fmt
brenzi Apr 10, 2024
27b70e0
add changelog
brenzi Apr 10, 2024
034662a
taplo fmt
brenzi Apr 10, 2024
d5a6362
taplo fmt
brenzi Apr 10, 2024
6a03ceb
revert formatting
brenzi Apr 10, 2024
0ed6eac
cleanup changelog formatting
brenzi Apr 10, 2024
aa4a013
align taplo fmt
brenzi Apr 10, 2024
ff96d4d
align taplo fmt
brenzi Apr 10, 2024
ebdde4f
Merge branch 'main' into ab/introduce_collator-selection
brenzi Apr 10, 2024
20edb93
add migration to initialize invulnerables
brenzi Apr 10, 2024
e252e42
fix no_std build
brenzi Apr 10, 2024
264d867
fix chainspec-generator
brenzi Apr 10, 2024
ad8733e
fix benchmarks build
brenzi Apr 10, 2024
8e5f948
zepter fix
brenzi Apr 10, 2024
db32586
Merge branch 'main' into ab/introduce_collator-selection
brenzi Apr 15, 2024
c4fec4c
Merge branch 'main' into ab/introduce_collator-selection
brenzi Apr 30, 2024
4503c34
revert spec version bump
brenzi Apr 30, 2024
4d582d2
burn half of CC fees
brenzi Apr 30, 2024
25b40a1
init candidacy bond to 5 KSM
brenzi Apr 30, 2024
bbf92f6
add try-runtime checks
brenzi Apr 30, 2024
3a8046d
make migration idempotent
brenzi Apr 30, 2024
7a09130
Update system-parachains/encointer/src/migrations_fix.rs
brenzi May 1, 2024
a9f4d16
inject fresh invulnerable accounts. leave existing aura keys to becom…
brenzi May 1, 2024
963b2a3
fix mappings between session and validator keys
brenzi May 1, 2024
6a75792
split CC fees between author and a dead account (burn)
brenzi May 1, 2024
9f5be6d
Merge branch 'main' into ab/introduce_collator-selection
brenzi May 1, 2024
1a65536
Merge branch 'main' into ab/introduce_collator-selection
brenzi May 7, 2024
b6231a6
Merge branch 'main' into ab/introduce_collator-selection
brenzi May 7, 2024
d6bc232
Merge branch 'main' into ab/introduce_collator-selection
brenzi May 8, 2024
fb090ed
Merge remote-tracking branch 'upstream/main' into ab/introduce_collat…
brenzi May 21, 2024
782d5a9
clippy after merge
brenzi May 21, 2024
201a36d
Merge branch 'main' into ab/introduce_collator-selection
brenzi May 21, 2024
343e93e
fix changelog
brenzi May 21, 2024
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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Remove DMP queue and allow `system::authorize_upgrade` in XCM's call filter ([polkadot-fellows/runtimes#280](https://github.com/polkadot-fellows/runtimes/pull/280))
- Add migration to Kusama Coretime to onboard People Chain without long delay ([polkadot-fellows/runtimes#286](https://github.com/polkadot-fellows/runtimes/pull/286))
- Clean up outdated assignment in Kusama Coretime Chain state ([polkadot-fellows/runtimes#286](https://github.com/polkadot-fellows/runtimes/pull/286))
- Introduce [Encointer](https://encointer.org) collator selection and send fees to authors instead of treasury ([polkadot-fellows/runtimes#270](https://github.com/polkadot-fellows/runtimes/pull/270))

### Fixed

Expand All @@ -31,7 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Remove state-trie-migration pallet from kusama, add state trie migration to V1 on polkadot ([polkadot-fellows/runtimes#170](https://github.com/polkadot-fellows/runtimes/pull/170))
- Introduce chain spec generator ([polkadot-fellows/runtimes#127](https://github.com/polkadot-fellows/runtimes/pull/127))
- Add [Encointer](https://encointer.org) system parachain runtime, completing [RFC22](https://github.com/polkadot-fellows/RFCs/blob/main/text/
0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80))
0022-adopt-encointer-runtime.md) ([polkadot-fellows/runtimes#80](https://github.com/polkadot-fellows/runtimes/pull/80))
brenzi marked this conversation as resolved.
Show resolved Hide resolved
- Feature for enabling debug prints in the Polkadot and Kusama runtime ([polkadot-fellows/runtimes#85](https://github.com/polkadot-fellows/runtimes/pull/85))
- Added new "Wish for Change" track ([polkadot-fellows/runtimes#184](https://github.com/polkadot-fellows/runtimes/pull/184))
- Enable Coretime and on-demand on Kusama ([polkadot-fellows/runtimes#159](https://github.com/polkadot-fellows/runtimes/pull/159))
Expand Down
10 changes: 6 additions & 4 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pallet-encointer-ceremonies = { version = "~6.1.0", default-features = false }
pallet-encointer-ceremonies-rpc-runtime-api = { version = "~6.1.0", default-features = false }
pallet-encointer-communities = { version = "~6.1.0", default-features = false }
pallet-encointer-communities-rpc-runtime-api = { version = "~6.1.0", default-features = false }
pallet-encointer-faucet = { version = "~6.1.0", default-features = false }
pallet-encointer-faucet = { version = "~6.2.0", default-features = false }
pallet-encointer-reputation-commitments = { version = "~6.1.0", default-features = false }
pallet-encointer-scheduler = { version = "~6.1.0", default-features = false }
pallet-fast-unstake = { version = "28.0.0", default-features = false }
Expand Down
17 changes: 17 additions & 0 deletions chain-spec-generator/src/system_parachains_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,23 @@ fn encointer_kusama_genesis(endowed_accounts: Vec<AccountId>, id: u32) -> serde_
parachain_id: id.into(),
..Default::default()
},
"collatorSelection": encointer_kusama_runtime::CollatorSelectionConfig {
invulnerables: invulnerables().iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: ENCOINTER_KUSAMA_ED * 16,
..Default::default()
},
"session": asset_hub_kusama_runtime::SessionConfig {
keys: invulnerables()
.into_iter()
.map(|(acc, aura)| {
(
acc.clone(), // account id
acc, // validator id
asset_hub_kusama_session_keys(aura), // session keys
)
})
.collect(),
},
"polkadotXcm": {
"safeXcmVersion": Some(SAFE_XCM_VERSION),
},
Expand Down
39 changes: 22 additions & 17 deletions system-parachains/encointer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@ version.workspace = true

[dependencies]
codec = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = [
"derive",
"derive",
] }
hex-literal = { optional = true , workspace = true }
hex-literal = { workspace = true }
log = { workspace = true }
scale-info = { features = [
"derive",
] , workspace = true }
scale-info = { features = ["derive"], workspace = true }
smallvec = { workspace = true }


Expand Down Expand Up @@ -53,31 +51,32 @@ frame-system-benchmarking = { optional = true, workspace = true }
frame-system-rpc-runtime-api = { workspace = true }
frame-try-runtime = { optional = true, workspace = true }
pallet-asset-tx-payment = { workspace = true }
pallet-aura = { features = ["experimental"] , workspace = true }
pallet-aura = { features = ["experimental"], workspace = true }
pallet-authorship = { workspace = true }
pallet-balances = { workspace = true }
pallet-collective = { workspace = true }
pallet-insecure-randomness-collective-flip = { workspace = true }
pallet-membership = { workspace = true }
pallet-message-queue = { workspace = true }
pallet-proxy = { workspace = true }
pallet-scheduler = { workspace = true }
pallet-session = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-transaction-payment = { workspace = true }
pallet-transaction-payment-rpc-runtime-api = { workspace = true }
pallet-treasury = { workspace = true }
pallet-utility = { workspace = true }
sp-api = { workspace = true }
sp-block-builder = { workspace = true }
sp-consensus-aura = { workspace = true }
sp-core = { workspace = true }
sp-genesis-builder = { workspace = true }
sp-inherents = { workspace = true }
sp-offchain = { workspace = true }
sp-runtime = { workspace = true }
sp-session = { workspace = true }
sp-std = { workspace = true }
sp-transaction-pool = { workspace = true }
sp-version = { workspace = true }
sp-genesis-builder = { workspace = true }

# Polkadot dependencies
pallet-xcm = { workspace = true }
Expand All @@ -90,13 +89,15 @@ xcm-executor = { package = "staging-xcm-executor", default-features = false, ver
# Cumulus dependencies
cumulus-pallet-aura-ext = { workspace = true }
cumulus-pallet-parachain-system = { features = [
"parameterized-consensus-hook",
"parameterized-consensus-hook",
], workspace = true }
cumulus-pallet-session-benchmarking = { optional = true, workspace = true }
cumulus-pallet-xcm = { workspace = true }
cumulus-pallet-xcmp-queue = { workspace = true }
cumulus-primitives-aura = { workspace = true }
cumulus-primitives-core = { workspace = true }
cumulus-primitives-utility = { workspace = true }
pallet-collator-selection = { workspace = true }
parachain-info = { package = "staging-parachain-info", default-features = false, version = "0.8.0" }
parachains-common = { workspace = true }
polkadot-core-primitives = { workspace = true }
Expand All @@ -118,12 +119,13 @@ default = ["std"]
runtime-benchmarks = [
"cumulus-pallet-xcmp-queue/runtime-benchmarks",
"cumulus-pallet-parachain-system/runtime-benchmarks",
"cumulus-pallet-session-benchmarking/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system-benchmarking/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"hex-literal",
"pallet-balances/runtime-benchmarks",
"pallet-collator-selection/runtime-benchmarks",
"pallet-collective/runtime-benchmarks",
"pallet-encointer-balances/runtime-benchmarks",
"pallet-encointer-bazaar/runtime-benchmarks",
Expand All @@ -136,7 +138,6 @@ runtime-benchmarks = [
"pallet-membership/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
"pallet-timestamp/runtime-benchmarks",
"pallet-treasury/runtime-benchmarks",
"pallet-utility/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
Expand All @@ -151,12 +152,13 @@ runtime-benchmarks = [
"pallet-scheduler/runtime-benchmarks",
"parachains-common/runtime-benchmarks",
"polkadot-parachain-primitives/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks"
"polkadot-primitives/runtime-benchmarks",
]
std = [
"codec/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-session-benchmarking?/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-aura/std",
Expand All @@ -174,7 +176,9 @@ std = [
"log/std",
"pallet-asset-tx-payment/std",
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-collator-selection/std",
"pallet-collective/std",
"pallet-encointer-balances/std",
"pallet-encointer-bazaar-rpc-runtime-api/std",
Expand All @@ -190,10 +194,10 @@ std = [
"pallet-message-queue/std",
"pallet-membership/std",
"pallet-proxy/std",
"pallet-session/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-treasury/std",
"pallet-utility/std",
"pallet-xcm/std",
"parachain-info/std",
Expand Down Expand Up @@ -221,7 +225,7 @@ std = [
"polkadot-core-primitives/std",
"polkadot-parachain-primitives/std",
"polkadot-primitives/std",
"polkadot-runtime-common/std"
"polkadot-runtime-common/std",
]


Expand All @@ -235,7 +239,9 @@ try-runtime = [
"frame-try-runtime/try-runtime",
"pallet-asset-tx-payment/try-runtime",
"pallet-aura/try-runtime",
"pallet-authorship/try-runtime",
"pallet-balances/try-runtime",
"pallet-collator-selection/try-runtime",
"pallet-collective/try-runtime",
"pallet-encointer-balances/try-runtime",
"pallet-encointer-bazaar/try-runtime",
Expand All @@ -249,21 +255,20 @@ try-runtime = [
"pallet-membership/try-runtime",
"pallet-proxy/try-runtime",
"pallet-scheduler/try-runtime",
"pallet-session/try-runtime",
"pallet-timestamp/try-runtime",
"pallet-transaction-payment/try-runtime",
"pallet-treasury/try-runtime",
"pallet-utility/try-runtime",
"pallet-xcm/try-runtime",
"parachain-info/try-runtime",
"encointer-balances-tx-payment/try-runtime",
"encointer-primitives/try-runtime",
"frame-support/try-runtime",
"polkadot-runtime-common/try-runtime",
"sp-runtime/try-runtime"
"sp-runtime/try-runtime",
]

# A feature that should be enabled when the runtime should be built for on-chain
# deployment. This will disable stuff that shouldn't be part of the on-chain wasm
# to make it smaller, like logging for example.
on-chain-release-build = ["sp-api/disable-logging"]

45 changes: 0 additions & 45 deletions system-parachains/encointer/src/deal_with_fees.rs

This file was deleted.

Loading
Loading