Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
81d2237
Draft of new sessions
gavofyork Jun 5, 2019
4fc86da
Reintroduce tuple impls
gavofyork Jun 5, 2019
d24568a
Merge remote-tracking branch 'origin/master' into gav-new-sessions
gavofyork Jun 5, 2019
84f1f1c
Move staking module to new session API
gavofyork Jun 5, 2019
5c67469
More work on staking and grandpa.
gavofyork Jun 5, 2019
5acfa04
Use iterator to avoid cloning and tuple macro
gavofyork Jun 5, 2019
fde708d
Make runtime build again
gavofyork Jun 6, 2019
b9b7d42
Polish the OpaqueKeys devex
gavofyork Jun 6, 2019
445df61
Move consensus logic into system & aura.
gavofyork Jun 6, 2019
4db0062
Fix up system module
gavofyork Jun 6, 2019
6696c55
Get build mostly going. Stuck at service.rs
gavofyork Jun 6, 2019
dc9e8c6
Building again
gavofyork Jun 6, 2019
7da4b04
Update srml/staking/src/lib.rs
gavofyork Jun 7, 2019
e2a0f2e
Refactoring out Consensus module, AuthorityIdOf, &c.
gavofyork Jun 7, 2019
6440ca8
Merge remote-tracking branch 'origin/gav-new-sessions' into gav-new-s…
gavofyork Jun 7, 2019
cfea92a
Refactored out DigestItem::AuthoritiesChanged. Building.
gavofyork Jun 7, 2019
d3de475
Remove tentative code
gavofyork Jun 7, 2019
a061fd7
Remove invalid comment
gavofyork Jun 7, 2019
7f303f9
Make Seal opaque and introduce nice methods for handling opaque items.
gavofyork Jun 7, 2019
a38084d
Merge remote-tracking branch 'origin/master' into gav-new-sessions
gavofyork Jun 7, 2019
f8b24e0
Start to use proper digest for Aura authorities tracking.
gavofyork Jun 8, 2019
fa47974
Fix up grandpa, remove system::Raw/Log
gavofyork Jun 8, 2019
dd93267
Refactor Grandpa to use new logging infrastructure.
gavofyork Jun 8, 2019
7a2b935
Building again
gavofyork Jun 8, 2019
4f9a5a3
Tidy up some AuthorityIds
gavofyork Jun 9, 2019
4871529
Expunge most of the rest of the AuthorityKey confusion.
gavofyork Jun 9, 2019
afeed88
Remove cruft
gavofyork Jun 9, 2019
d1d25e7
Untangle last of the `AuthorityId`s.
gavofyork Jun 9, 2019
bf081a5
Sort out finality_tracker
gavofyork Jun 9, 2019
77ec1ff
Refactor median getting
gavofyork Jun 9, 2019
a02de97
Apply suggestions from code review
Demi-Marie Jun 10, 2019
1cca243
Session tests works
gavofyork Jun 10, 2019
3bbd5ab
Merge remote-tracking branch 'origin/gav-new-sessions' into gav-new-s…
gavofyork Jun 10, 2019
6101aae
Update core/sr-primitives/src/generic/digest.rs
gavofyork Jun 10, 2019
5827ab5
Session tests works
gavofyork Jun 10, 2019
f8fa160
Merge remote-tracking branch 'origin/gav-new-sessions' into gav-new-s…
gavofyork Jun 10, 2019
8a9a4a5
Fix for staking from @dvc94ch
gavofyork Jun 10, 2019
9b4f1a4
log an error
gavofyork Jun 10, 2019
f650fe8
fix test runtime build
gavofyork Jun 10, 2019
ca4dda3
Some test fixes
gavofyork Jun 11, 2019
7b339ef
Fix build.
dvc94ch Jun 11, 2019
730b805
Move OpaqueKeys to primitives.
dvc94ch Jun 11, 2019
8203a7e
Staking mock update to new session api.
dvc94ch Jun 7, 2019
807c284
Use on_initialize instead of check_rotate_session.
dvc94ch Jun 11, 2019
ba4721f
Update tests to new staking api.
dvc94ch Jun 11, 2019
979f3b5
fixup mock
dvc94ch Jun 11, 2019
6e0cf27
Fix bond_extra_and_withdraw_unbonded_works.
dvc94ch Jun 11, 2019
4cafd87
Fix bond_with_little_staked_value_bounded_by_slot_stake.
dvc94ch Jun 11, 2019
4b5bd6b
Fix bond_with_no_staked_value.
dvc94ch Jun 11, 2019
48b0238
Fix change_controller_works.
dvc94ch Jun 11, 2019
379ddc9
Fix less_than_needed_candidates_works.
dvc94ch Jun 11, 2019
7990ce5
Fix multi_era_reward_should_work.
dvc94ch Jun 11, 2019
f3e7f97
Fix nominating_and_rewards_should_work.
dvc94ch Jun 11, 2019
94e58de
Fix nominators_also_get_slashed.
dvc94ch Jun 11, 2019
5404cbf
Fix phragmen_large_scale_test.
dvc94ch Jun 11, 2019
ff246dd
Fix phragmen_poc_works.
dvc94ch Jun 11, 2019
93843f9
Fix phragmen_score_should_be_accurate_on_large_stakes.
dvc94ch Jun 11, 2019
5cc1c44
Fix phragmen_should_not_overflow.
dvc94ch Jun 11, 2019
cfa5237
Fix reward_destination_works.
dvc94ch Jun 11, 2019
d90ffdc
Fix rewards_should_work.
dvc94ch Jun 11, 2019
8692b16
Fix sessions_and_eras_should_work.
dvc94ch Jun 11, 2019
5f1ad03
Fix slot_stake_is_least_staked_validator.
dvc94ch Jun 11, 2019
82946f5
Fix too_many_unbond_calls_should_not_work.
dvc94ch Jun 11, 2019
6b6acd5
Fix wrong_vote_is_null.
dvc94ch Jun 11, 2019
1822167
Fix runtime.
dvc94ch Jun 11, 2019
e87be9d
Fix wasm runtime build.
dvc94ch Jun 11, 2019
5f110d8
Update Cargo.lock
dvc94ch Jun 11, 2019
a5866a6
Fix warnings.
dvc94ch Jun 11, 2019
0378cff
Fix grandpa tests.
dvc94ch Jun 11, 2019
3f4b234
Fix test-runtime build.
dvc94ch Jun 11, 2019
71014e3
Fix template node build.
dvc94ch Jun 11, 2019
a97f98d
Fix stuff.
dvc94ch Jun 11, 2019
a75d3ad
Update Cargo.lock to fix CI
Demi-Marie Jun 11, 2019
3fb729b
Merge branch 'master' into gav-new-sessions
Demi-Marie Jun 12, 2019
cbd8437
Re-add missing AuRa logs
Demi-Marie Jun 12, 2019
99e58a7
Merge remote-tracking branch 'origin/master' into gav-new-sessions
gavofyork Jun 12, 2019
b8f6500
Update core/consensus/babe/src/digest.rs
gavofyork Jun 12, 2019
8c15101
Kill log trait and all that jazz.
gavofyork Jun 12, 2019
24d175c
Merge remote-tracking branch 'origin/gav-new-sessions' into gav-new-s…
gavofyork Jun 12, 2019
aa0956a
Refactor staking tests.
dvc94ch Jun 12, 2019
f788794
Fix ci runtime wasm check.
dvc94ch Jun 12, 2019
91a0495
Line length 120.
dvc94ch Jun 12, 2019
0399856
Make tests build again
gavofyork Jun 12, 2019
6ef0cb9
Merge remote-tracking branch 'origin/gav-new-sessions' into gav-new-s…
gavofyork Jun 12, 2019
b777ba9
Remove trailing commas in function declarations
Demi-Marie Jun 12, 2019
df313e0
Fix type error
Demi-Marie Jun 12, 2019
26f4a2d
Merge remote-tracking branch 'origin/master' into gav-new-sessions
Demi-Marie Jun 12, 2019
988e94d
Fix compilation errors
Demi-Marie Jun 12, 2019
ae7cc46
Fix a test
gavofyork Jun 13, 2019
f82c155
Another couple of fixes
gavofyork Jun 13, 2019
f8af78d
Fix another test
gavofyork Jun 13, 2019
ea77d7d
More test fixes
gavofyork Jun 13, 2019
b6a5548
Another test fix
gavofyork Jun 13, 2019
bb19f0b
Merge branch 'master' into gav-new-sessions
gavofyork Jun 13, 2019
3fcb3a7
Bump runtime.
gavofyork Jun 13, 2019
03249cd
Wrap long line
gavofyork Jun 13, 2019
56f5ac1
Fix build, remove redundant code.
gavofyork Jun 13, 2019
db47886
Issue to track TODO
gavofyork Jun 13, 2019
6b44e5f
Leave the benchmark code alone.
gavofyork Jun 13, 2019
2e8c85f
Merge remote-tracking branch 'origin/master' into gav-new-sessions
gavofyork Jun 13, 2019
5beee4b
Fix missing `std::time::{Instant, Duration}`
Demi-Marie Jun 13, 2019
3ee9625
Indentation
gavofyork Jun 14, 2019
0ad33b9
Aura ConsensusLog as enum
gavofyork Jun 14, 2019
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
Prev Previous commit
Next Next commit
Make runtime build again
  • Loading branch information
gavofyork committed Jun 6, 2019
commit fde708d2077aff5d99c8f304209de0576aaf7534
31 changes: 27 additions & 4 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#![recursion_limit="256"]

use rstd::prelude::*;
use parity_codec::{Encode, Decode};
use support::{construct_runtime, parameter_types};
use substrate_primitives::u32_trait::{_1, _2, _3, _4};
use node_primitives::{
Expand Down Expand Up @@ -135,10 +136,30 @@ impl timestamp::Trait for Runtime {
type OnTimestampSet = Aura;
}

parameter_types! {
pub const Period: BlockNumber = 10 * MINUTES;
pub const Offset: BlockNumber = 0;
}

#[derive(Default, Clone, PartialEq, Eq, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug))]
pub struct SessionKeys(AuthorityId);
impl session::OpaqueKeys for SessionKeys {
fn count() -> usize { 1 }
fn get_raw(&self, i: usize) -> &[u8] { if i == 0 { self.0.as_ref() } else { &[] } }
}

impl session::Trait for Runtime {
type ConvertAccountIdToSessionKey = ();
type OnSessionChange = (Staking, grandpa::SyncedAuthorities<Runtime>);
type OnSessionEnding = Staking;
type SessionHandler = (Grandpa,);
type ShouldEndSession = session::PeriodicSessions<Period, Offset>;
type Event = Event;
type Keys = SessionKeys;
}

parameter_types! {
pub const SessionsPerEra: session::SessionIndex = 6;
pub const BondingDuration: staking::EraIndex = 24 * 28;
}

impl staking::Trait for Runtime {
Expand All @@ -148,6 +169,8 @@ impl staking::Trait for Runtime {
type Event = Event;
type Slash = ();
type Reward = ();
type SessionsPerEra = SessionsPerEra;
type BondingDuration = BondingDuration;
}

const MINUTES: BlockNumber = 6;
Expand Down Expand Up @@ -223,7 +246,7 @@ impl grandpa::Trait for Runtime {
}

impl finality_tracker::Trait for Runtime {
type OnFinalizationStalled = grandpa::SyncedAuthorities<Runtime>;
type OnFinalizationStalled = ();// TODO: should record this for next time the session changes.
}

construct_runtime!(
Expand All @@ -238,7 +261,7 @@ construct_runtime!(
Consensus: consensus::{Module, Call, Storage, Config<T>, Log(AuthoritiesChange), Inherent},
Indices: indices,
Balances: balances,
Session: session,
Session: session::{Module, Call, Storage, Event},
Staking: staking::{default, OfflineWorker},
Democracy: democracy,
Council: council::{Module, Call, Storage, Event<T>},
Expand Down