Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fca586d
grandpa: set justification period to 512 blocks (#445)
andresilva Sep 24, 2019
e922e4f
lock (#446)
gui1117 Sep 24, 2019
b9d2b35
update kusama.json to CC2
rphmeier Sep 24, 2019
5020fa4
update kusama.json
rphmeier Sep 26, 2019
d3c1f45
polkadot v0.6.1 (#461)
andresilva Oct 5, 2019
9c72bfd
polkadot v0.6.2 (#464)
andresilva Oct 7, 2019
c0399d4
ci: backport gitlab-ci.yml from master branch (#481)
gabreal Oct 17, 2019
72969c3
ci: backport #488 - fix publishing of ci builds (#489)
gabreal Oct 22, 2019
1f576dd
Backports to v0.6 (#493)
andresilva Oct 23, 2019
a467bb2
service: don't use the grandpa observer (#494)
andresilva Oct 25, 2019
2c8a404
v0.6: merge master branch (#497)
andresilva Oct 25, 2019
1d89023
Final tweaks for Kusama PrePos. (#499)
gavofyork Oct 25, 2019
0dd165b
Enable nicknaming for accounts (#500)
gavofyork Oct 27, 2019
c35a30d
Bump version
gavofyork Oct 27, 2019
5e94cda
Merge branch 'v0.6' of github.com:paritytech/polkadot into v0.6
gavofyork Oct 27, 2019
9bf2655
Update substrate to bring in forced nicks (#502)
gavofyork Oct 27, 2019
3fa5755
Fix locking, from an updated Substrate (#506)
gavofyork Oct 28, 2019
a15c029
Bump version
gavofyork Oct 28, 2019
775a6d5
Integrate fee RPC (#508) (#511)
gavofyork Oct 28, 2019
39397ab
Backport of Substrate update (#515)
gavofyork Oct 29, 2019
cd2a578
Backports from master (#525)
gavofyork Oct 31, 2019
ccd1c6e
Backports (#528)
gavofyork Nov 2, 2019
1e6c88b
Bump Substrate and versions (#531)
gavofyork Nov 3, 2019
7c334e2
Enable governance (#536)
gavofyork Nov 4, 2019
d102bc5
Bump substrate, versions. (#538)
gavofyork Nov 5, 2019
c137033
Revert substrate (#540)
gavofyork Nov 5, 2019
fffa22d
Version bump
gavofyork Nov 5, 2019
b26a1d7
Bump Substrate, versions. (#542)
gavofyork Nov 6, 2019
a5361b1
Bump Substrate (#544)
gavofyork Nov 7, 2019
a2208bb
Enable Wasmtime building (#545)
gavofyork Nov 7, 2019
3489548
Bump Substrate (#547)
gavofyork Nov 7, 2019
b8baab4
Enable grandpa migration. (#549)
gavofyork Nov 7, 2019
2cd9de1
add comments for WonRenewal event (#533) (#550)
xlc Nov 8, 2019
0b08f26
Bump versions & Substrate (#554)
gavofyork Nov 8, 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
Backport of Substrate update (#515)
* Update Substrate (#514)

* Update Substrate

* Attempt a fix

* Update substrate again

* Fix compilation

* update substrate add support for sentry

* Fixes tests

* Actually update substrate
  • Loading branch information
gavofyork authored Oct 29, 2019
commit 39397abb75770534d5fcdc21109b59f1a8d623de
279 changes: 138 additions & 141 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub use service::{
};

pub use cli::{VersionInfo, IntoExit, NoCustom};
pub use cli::error;
pub use cli::{display_role, error};

/// Abstraction over an executor that lets you spawn tasks in the background.
pub type TaskExecutor = Arc<dyn futures::future::Executor<Box<dyn Future<Item = (), Error = ()> + Send>> + Send + Sync>;
Expand Down Expand Up @@ -98,7 +98,7 @@ pub fn run<W>(worker: W, version: cli::VersionInfo) -> error::Result<()> where
info!(" by {}, 2017-2019", version.author);
info!("Chain specification: {}", config.chain_spec.name());
info!("Node name: {}", config.name);
info!("Roles: {:?}", config.roles);
info!("Roles: {}", display_role(&config));
config.custom = worker.configuration();
let runtime = Runtime::new().map_err(|e| format!("{:?}", e))?;
match config.roles {
Expand Down
28 changes: 7 additions & 21 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ use client::{
runtime_api as client_api, impl_runtime_apis,
};
use sr_primitives::{
create_runtime_str, generic, impl_opaque_keys, key_types,
create_runtime_str, generic, impl_opaque_keys,
ApplyResult, Permill, Perbill, RuntimeDebug,
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
weights::{Weight, DispatchInfo}, curve::PiecewiseLinear,
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension},
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys},
};
use version::RuntimeVersion;
use grandpa::{AuthorityId as GrandpaId, fg_primitives};
use babe_primitives::{AuthorityId as BabeId};
#[cfg(any(feature = "std", test))]
use version::NativeVersion;
use substrate_primitives::OpaqueMetadata;
Expand Down Expand Up @@ -256,35 +255,22 @@ parameter_types! {
pub const Offset: BlockNumber = 0;
}

// !!!!!!!!!!!!!
// WARNING!!!!!! SEE NOTE BELOW BEFORE TOUCHING THIS CODE
// !!!!!!!!!!!!!
type SessionHandlers = (Grandpa, Babe, ImOnline, Parachains);
impl_opaque_keys! {
pub struct SessionKeys {
#[id(key_types::GRANDPA)]
pub grandpa: GrandpaId,
#[id(key_types::BABE)]
pub babe: BabeId,
#[id(key_types::IM_ONLINE)]
pub im_online: ImOnlineId,
#[id(parachain::PARACHAIN_KEY_TYPE_ID)]
pub parachain_validator: parachain::ValidatorId,
pub grandpa: Grandpa,
pub babe: Babe,
pub im_online: ImOnline,
pub parachain_validator: Parachains,
}
}
// NOTE: `SessionHandler` and `SessionKeys` are co-dependent: One key will be used for each handler.
// The number and order of items in `SessionHandler` *MUST* be the same number and order of keys in
// `SessionKeys`.
// TODO: Introduce some structure to tie these together to make it a bit less of a footgun. This
// should be easy, since OneSessionHandler trait provides the `Key` as an associated type. #2858

parameter_types! {
pub const DisabledValidatorsThreshold: Perbill = Perbill::from_percent(17);
}

impl session::Trait for Runtime {
type OnSessionEnding = Staking;
type SessionHandler = SessionHandlers;
type SessionHandler = <SessionKeys as OpaqueKeys>::KeyTypeIdProviders;
type ShouldEndSession = Babe;
type Event = Event;
type Keys = SessionKeys;
Expand Down
16 changes: 11 additions & 5 deletions runtime/src/parachains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,10 @@ impl<T: Trait> Module<T> {
*/
}

impl<T: Trait> sr_primitives::BoundToRuntimeAppPublic for Module<T> {
type Public = ValidatorId;
}

impl<T: Trait> session::OneSessionHandler<T::AccountId> for Module<T> {
type Key = ValidatorId;

Expand Down Expand Up @@ -902,13 +906,14 @@ mod tests {
use substrate_primitives::{H256, Blake2Hasher};
use substrate_trie::NodeCodec;
use sr_primitives::{
Perbill,
Perbill, curve::PiecewiseLinear, testing::{UintAuthorityId, Header},
traits::{BlakeTwo256, IdentityLookup, OnInitialize, OnFinalize},
testing::{UintAuthorityId, Header},
curve::PiecewiseLinear,
};
use primitives::{
parachain::{CandidateReceipt, HeadData, ValidityAttestation, ValidatorId, Info as ParaInfo, Scheduling},
parachain::{
CandidateReceipt, HeadData, ValidityAttestation, ValidatorId, Info as ParaInfo,
Scheduling,
},
BlockNumber,
};
use crate::constants::time::*;
Expand Down Expand Up @@ -940,6 +945,7 @@ mod tests {
pub const MaximumBlockLength: u32 = 4 * 1024 * 1024;
pub const AvailableBlockRatio: Perbill = Perbill::from_percent(75);
}

impl system::Trait for Test {
type Origin = Origin;
type Call = Call;
Expand Down Expand Up @@ -968,7 +974,7 @@ mod tests {
type OnSessionEnding = ();
type Keys = UintAuthorityId;
type ShouldEndSession = session::PeriodicSessions<Period, Offset>;
type SessionHandler = ();
type SessionHandler = session::TestSessionHandler;
type Event = ();
type SelectInitialValidators = staking::Module<Self>;
type ValidatorId = u64;
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/registrar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ mod tests {
type OnSessionEnding = ();
type Keys = UintAuthorityId;
type ShouldEndSession = session::PeriodicSessions<Period, Offset>;
type SessionHandler = ();
type SessionHandler = session::TestSessionHandler;
type Event = ();
type SelectInitialValidators = ();
type ValidatorId = u64;
Expand Down
13 changes: 11 additions & 2 deletions service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ pub fn new_full(config: Configuration<CustomConfiguration, GenesisConfig>)
let disable_grandpa = config.disable_grandpa;
let name = config.name.clone();

// sentry nodes announce themselves as authorities to the network
// and should run the same protocols authorities do, but it should
// never actively participate in any consensus process.
let participates_in_consensus = is_authority && !config.sentry_mode;

let (builder, mut import_setup, inherent_data_providers) = new_full_start!(config);

// Dht event channel from the network to the authority discovery module. Use
Expand Down Expand Up @@ -204,7 +209,7 @@ pub fn new_full(config: Configuration<CustomConfiguration, GenesisConfig>)
(is_known, client.clone()),
);

if is_authority {
if participates_in_consensus {
let availability_store = {
use std::path::PathBuf;

Expand Down Expand Up @@ -264,7 +269,9 @@ pub fn new_full(config: Configuration<CustomConfiguration, GenesisConfig>)
service.spawn_essential_task(babe);
}

let keystore = if is_authority {
// if the node isn't actively participating in consensus then it doesn't
// need a keystore, regardless of which protocol we use below.
let keystore = if participates_in_consensus {
Some(service.keystore())
} else {
None
Expand All @@ -275,7 +282,9 @@ pub fn new_full(config: Configuration<CustomConfiguration, GenesisConfig>)
gossip_duration: Duration::from_millis(333),
justification_period: 512,
name: Some(name),
observer_enabled: false,
keystore,
is_authority,
};

let enable_grandpa = !disable_grandpa;
Expand Down