Skip to content

Commit

Permalink
Merge branch 'main' into kiz-inflation-dot-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ggwpez authored Oct 1, 2024
2 parents 9d486d9 + 6df0558 commit f206b08
Show file tree
Hide file tree
Showing 10 changed files with 291 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Allow signed origins to send arbitrary XCMs from some system chains ([polkadot-fellows/runtimes#407](https://github.com/polkadot-fellows/runtimes/pull/407))
- Include the Core and Salary pallets into the Fellowship proxy ([polkadot-fellows/runtimes#454](https://github.com/polkadot-fellows/runtimes/pull/454))
- Add new community democracy and treasuries pallets to Encointer ([polkadot-fellows/runtimes#456](https://github.com/polkadot-fellows/runtimes/pull/456))

### Fixed

Expand Down Expand Up @@ -88,6 +89,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

#### From [#322](https://github.com/polkadot-fellows/runtimes/pull/322):

- The `MessageQueue` also runs "on idle", this causes `MessageQueue::Processed` events to be emitted in other phases than just initialization ([SDK v1.13 #3844](https://github.com/paritytech/polkadot-sdk/pull/3844)).
- AdaptPrice trait is now price controlled ([SDK v1.13 #4521](https://github.com/paritytech/polkadot-sdk/pull/4521)).
- Allow StakingAdmin to manage nomination pool configurations ([SDK v1.11 #3959](https://github.com/paritytech/polkadot-sdk/pull/3959)).
- Bridge: make some headers submissions free ([SDK v1.12 #4102](https://github.com/paritytech/polkadot-sdk/pull/4102)).
Expand Down
68 changes: 66 additions & 2 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ emulated-integration-tests-common = { version = "11.0.0" }
encointer-balances-tx-payment = { version = "~13.1.0", default-features = false }
encointer-balances-tx-payment-rpc-runtime-api = { version = "~13.1.0", default-features = false }
encointer-kusama-runtime = { path = "system-parachains/encointer" }
encointer-primitives = { version = "~13.2.0", default-features = false }
encointer-primitives = { version = "~13.3.0", default-features = false }
enumflags2 = { version = "0.7.7" }
frame-benchmarking = { version = "36.0.0", default-features = false }
frame-election-provider-support = { version = "36.0.0", default-features = false }
Expand Down Expand Up @@ -114,9 +114,12 @@ pallet-encointer-ceremonies = { version = "~13.1.0", default-features = false }
pallet-encointer-ceremonies-rpc-runtime-api = { version = "~13.1.0", default-features = false }
pallet-encointer-communities = { version = "~13.1.0", default-features = false }
pallet-encointer-communities-rpc-runtime-api = { version = "~13.1.0", default-features = false }
pallet-encointer-democracy = { version = "~13.3.2", default-features = false }
pallet-encointer-faucet = { version = "~13.2.0", default-features = false }
pallet-encointer-reputation-commitments = { version = "~13.1.0", default-features = false }
pallet-encointer-scheduler = { version = "~13.1.0", default-features = false }
pallet-encointer-treasuries = { version = "~13.3.0", default-features = false }
pallet-encointer-treasuries-rpc-runtime-api = { version = "~13.3.0", default-features = false }
pallet-fast-unstake = { version = "35.0.0", default-features = false }
pallet-glutton = { version = "22.0.0", default-features = false }
pallet-grandpa = { version = "36.0.0", default-features = false }
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,25 @@ The release process is building all runtimes and then puts them into a release i

The format of [`CHANGELOG.md`](CHANGELOG.md) is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Release guidelines

Here is an overview of the recommended steps.

|Steps |Description |
|------|------------|
|0 |Open an [issue](https://github.com/polkadot-fellows/runtimes/issues) for the release in the runtimes repo with the **version number**. |
|1 |Update **[polkadot-sdk](https://github.com/paritytech/polkadot-sdk?tab=readme-ov-file#-releases)**, if applicable. |
|2 |Identify and monitor **potential blockers** (old dependencies, pending or failed upgrades). |
|3 |Identify and include **PRs** with required tests, highlighting the integration tests that have changed. |
|4 |Identify and communicate all details about **potential breaking changes** (transaction/event/error encoding, polkadot-sdk migrations, XCM and storage format, etc.) or **disruptions**. Make sure to **ping @SBalaguer and @anaelleltd** in your commentary. |
|5 |Run **[benchmarking](https://github.com/polkadot-fellows/runtimes/blob/main/docs/weight-generation.md)** for changed pallets. |
|6 |Trigger the release for **final reviews**, making sure to highlight information about all breaking changes or disruptions in the **CHANGELOG entry**. |
|7 |Create the **[whitelisting proposal (Fellowship)](https://github.com/joepetrowski/opengov-cli)** with contextual information.|
|8 |Create the **[whitelisted caller referendum (OpenGov)](https://github.com/joepetrowski/opengov-cli)** with contextual information and **instructions for following up** on breaking changes or disruptions. |
|9 |Close the issue for the release once the referendum is **approved and executed**. |
|10 |Open an issue for **the next release** in the runtimes repo, if applicable.|


## Communication channels

The Fellowship is using Matrix for communication. Right now there exists two channels:
Expand Down
22 changes: 22 additions & 0 deletions docs/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!--
Make sure to familiarise yourself with the Runtime release process at https://github.com/polkadot-fellows/runtimes?tab=readme-ov-file#release-process
and the Runtime release guidelines at https://github.com/polkadot-fellows/runtimes?tab=readme-ov-file#release-guidelines.
Use this PR template to streamline the release process, communicate on the changes that you are proposing, and provide a clear course of action for network stakeholders.
-->

<!---
1) What kind of changes does this PR introduce?
Indicate if merging this PR will result in breaking changes (e.g. changes to transaction/event/error encoding, polkadot-sdk migrations, or XCM and storage format) or disruptions for network stakeholders.
When submitting a breaking change, please make sure to ping @SBalaguer and @anaelleltd so that they can notify ecosystem teams and builders.
Otherwise, ignore sections 1 and 2.
-->

<!---
2) Who will be impacted by theses changes in practice and how should they follow up on these changes?
Indicate all network stakeholders (e.g. teams working on parachains or live networks, wallets, UIs, CEXes, or DEXes) that this PR will affect.
Recommend a course of action (e.g. resources for code refactoring or further reading) for network stakeholders.
-->

<!-- Remember that you can run `/merge` to enable auto-merge in the PR. -->
<!-- Remember to modify the changelog and highlight all breaking changes or disruptions. Otherwise, indicate if this is not needed. -->
- [ ] Does not require a CHANGELOG entry
10 changes: 10 additions & 0 deletions system-parachains/encointer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ pallet-encointer-ceremonies = { workspace = true }
pallet-encointer-ceremonies-rpc-runtime-api = { workspace = true }
pallet-encointer-communities = { workspace = true }
pallet-encointer-communities-rpc-runtime-api = { workspace = true }
pallet-encointer-democracy = { workspace = true }
pallet-encointer-faucet = { workspace = true }
pallet-encointer-reputation-commitments = { workspace = true }
pallet-encointer-scheduler = { workspace = true }
pallet-encointer-treasuries = { workspace = true }
pallet-encointer-treasuries-rpc-runtime-api = { workspace = true }


# Substrate
Expand Down Expand Up @@ -132,9 +135,11 @@ runtime-benchmarks = [
"pallet-encointer-bazaar/runtime-benchmarks",
"pallet-encointer-ceremonies/runtime-benchmarks",
"pallet-encointer-communities/runtime-benchmarks",
"pallet-encointer-democracy/runtime-benchmarks",
"pallet-encointer-faucet/runtime-benchmarks",
"pallet-encointer-reputation-commitments/runtime-benchmarks",
"pallet-encointer-scheduler/runtime-benchmarks",
"pallet-encointer-treasuries/runtime-benchmarks",
"pallet-membership/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-proxy/runtime-benchmarks",
Expand Down Expand Up @@ -188,9 +193,12 @@ std = [
"pallet-encointer-ceremonies/std",
"pallet-encointer-communities-rpc-runtime-api/std",
"pallet-encointer-communities/std",
"pallet-encointer-democracy/std",
"pallet-encointer-faucet/std",
"pallet-encointer-reputation-commitments/std",
"pallet-encointer-scheduler/std",
"pallet-encointer-treasuries-rpc-runtime-api/std",
"pallet-encointer-treasuries/std",
"pallet-insecure-randomness-collective-flip/std",
"pallet-membership/std",
"pallet-message-queue/std",
Expand Down Expand Up @@ -253,9 +261,11 @@ try-runtime = [
"pallet-encointer-bazaar/try-runtime",
"pallet-encointer-ceremonies/try-runtime",
"pallet-encointer-communities/try-runtime",
"pallet-encointer-democracy/try-runtime",
"pallet-encointer-faucet/try-runtime",
"pallet-encointer-reputation-commitments/try-runtime",
"pallet-encointer-scheduler/try-runtime",
"pallet-encointer-treasuries/try-runtime",
"pallet-insecure-randomness-collective-flip/try-runtime",
"pallet-membership/try-runtime",
"pallet-message-queue/try-runtime",
Expand Down
30 changes: 30 additions & 0 deletions system-parachains/encointer/src/genesis_config_presets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,36 @@ fn encointer_kusama_genesis(
"polkadotXcm": {
"safeXcmVersion": Some(SAFE_XCM_VERSION),
},
"encointerScheduler": {
"currentPhase": CeremonyPhaseType::Registering,
"currentCeremonyIndex": 1,
"phaseDurations": vec![
(CeremonyPhaseType::Registering, 604800000u64), // 7d
(CeremonyPhaseType::Assigning, 86400000u64), // 1d
(CeremonyPhaseType::Attesting, 172800000u64), // 2d
],
},
"encointerCeremonies": {
"ceremonyReward": BalanceType::from_num(1),
"timeTolerance": 600_000u64, // +-10min
"locationTolerance": 1_000, // [m]
"endorsementTicketsPerBootstrapper": 10,
"endorsementTicketsPerReputable": 5,
"reputationLifetime": 5,
"inactivityTimeout": 5, // idle ceremonies before purging community
"meetupTimeOffset": 0,
},
"encointerCommunities": {
"minSolarTripTimeS": 1, // [s]
"maxSpeedMps": 1, // [m/s] suggested would be 83m/s for security,
},
"encointerBalances": {
// for relative adjustment.
"feeConversionFactor": 7_143u32,
},
"encointerFaucet": {
"reserveAmount": 10_000_000_000_000u128,
},
// no need to pass anything to aura, in fact it will panic if we do. Session will take care
// of this. `aura: Default::default()`
})
Expand Down
37 changes: 35 additions & 2 deletions system-parachains/encointer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ use frame_support::{
traits::{
fungibles::{Balanced, Credit},
tokens::{imbalance::ResolveTo, ConversionToAssetBalance},
ConstBool, ConstU64, Contains, EitherOfDiverse, EqualPrivilegeOnly, InstanceFilter,
TransformOrigin,
ConstBool, ConstU128, ConstU64, Contains, EitherOfDiverse, EqualPrivilegeOnly,
InstanceFilter, TransformOrigin,
},
weights::{ConstantMultiplier, Weight, WeightToFee as _},
PalletId,
Expand Down Expand Up @@ -545,6 +545,29 @@ impl pallet_encointer_faucet::Config for Runtime {
type WeightInfo = weights::pallet_encointer_faucet::WeightInfo<Runtime>;
}

parameter_types! {
pub const ConfirmationPeriod: Moment = 2 * 24 * 3600 * 1000; // [ms]
pub const ProposalLifetime: Moment = 9 * 24 * 3600 * 1000; // [ms]
}

impl pallet_encointer_democracy::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type MaxReputationCount = ConstU32<64>;
type ConfirmationPeriod = ConfirmationPeriod;
type ProposalLifetime = ProposalLifetime;
type MinTurnout = ConstU128<50>; // perthousand of electorate: 1 = 0.1%, 50 = 5.0%
type WeightInfo = weights::pallet_encointer_democracy::WeightInfo<Runtime>;
}

parameter_types! {
pub const TreasuriesPalletId: PalletId = PalletId(*b"trsrysId");
}
impl pallet_encointer_treasuries::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type Currency = pallet_balances::Pallet<Runtime>;
type PalletId = TreasuriesPalletId;
}

impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
Expand Down Expand Up @@ -724,6 +747,8 @@ construct_runtime! {
EncointerBazaar: pallet_encointer_bazaar = 64,
EncointerReputationCommitments: pallet_encointer_reputation_commitments = 65,
EncointerFaucet: pallet_encointer_faucet = 66,
EncointerDemocracy: pallet_encointer_democracy = 67,
EncointerTreasuries: pallet_encointer_treasuries = 68,
}
}

Expand Down Expand Up @@ -788,6 +813,7 @@ mod benches {
[pallet_encointer_bazaar, EncointerBazaar]
[pallet_encointer_ceremonies, EncointerCeremonies]
[pallet_encointer_communities, EncointerCommunities]
[pallet_encointer_democracy, EncointerDemocracy]
[pallet_encointer_faucet, EncointerFaucet]
[pallet_encointer_reputation_commitments, EncointerReputationCommitments]
[pallet_encointer_scheduler, EncointerScheduler]
Expand Down Expand Up @@ -1031,6 +1057,13 @@ impl_runtime_apis! {
}
}

impl pallet_encointer_treasuries_rpc_runtime_api::TreasuriesApi<Block, AccountId> for Runtime {

fn get_community_treasury_account_unchecked(maybecid: &Option<CommunityIdentifier>) -> AccountId {
EncointerTreasuries::get_community_treasury_account_unchecked(*maybecid)
}
}

impl sp_genesis_builder::GenesisBuilder<Block> for Runtime {
fn build_state(config: Vec<u8>) -> sp_genesis_builder::Result {
build_state::<RuntimeGenesisConfig>(config)
Expand Down
1 change: 1 addition & 0 deletions system-parachains/encointer/src/weights/mod.rs

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

Loading

0 comments on commit f206b08

Please sign in to comment.