Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9062f94
value ranges in consensus cache
svyatonik Aug 2, 2019
ce451c3
skip values in cache
svyatonik Aug 2, 2019
2efc6a4
read epoch0 + epoch1 data from genesis in babe
svyatonik Aug 2, 2019
d9d75bc
sync authorities + session validators at genesis
svyatonik Aug 4, 2019
aa491d0
removed some debug printlns
svyatonik Aug 4, 2019
de097ee
fixed cache encoding
svyatonik Aug 5, 2019
4bbebde
Revert "skip values in cache"
svyatonik Aug 5, 2019
2897a83
Revert "value ranges in consensus cache"
svyatonik Aug 5, 2019
2c72a87
get rid of cache::AUTHORITIES in Babe
svyatonik Aug 5, 2019
1c7b2cd
cleaning up
svyatonik Aug 5, 2019
cb2851f
cleaning up
svyatonik Aug 5, 2019
e5c7bd8
update spec version
svyatonik Aug 5, 2019
a838e9b
lost changes
svyatonik Aug 5, 2019
200a638
fixed tests
svyatonik Aug 5, 2019
3c420ff
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 5, 2019
c4c6788
Update node/runtime/src/lib.rs
svyatonik Aug 6, 2019
04f73d5
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 6, 2019
f30f0fb
fix once-per-block condition
svyatonik Aug 6, 2019
773982b
fix standalone babe + temp_storage in BuildGenesis
svyatonik Aug 6, 2019
c922fad
fix benhes compilation
svyatonik Aug 6, 2019
69fe38a
fixed comment
svyatonik Aug 6, 2019
b5e223e
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 8, 2019
54fd261
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 12, 2019
5991212
re-added light nodes to integration tests
svyatonik Aug 12, 2019
d24bb0b
Merge branch 'master' into fix_flaming_fir_light_sync
Demi-Marie Aug 14, 2019
51b79fc
finalize_with_ancestors from extra_requests
svyatonik Aug 14, 2019
651d8ad
Merge branch 'fix_flaming_fir_light_sync' of https://github.com/parit…
svyatonik Aug 14, 2019
8f106ae
post-merge fix
svyatonik Aug 14, 2019
b4dd1bd
aaand removed debug code
svyatonik Aug 14, 2019
d593290
(another one)
svyatonik Aug 14, 2019
a7adc1c
fix warn in logs (do not call ForkTree::finalize twice for the same b…
svyatonik Aug 14, 2019
707b288
sync digest.next_authorities with actual next authorities
svyatonik Aug 14, 2019
f1d0e41
more docs
svyatonik Aug 15, 2019
515587c
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 15, 2019
b328acb
reverting all commits affecting storage
svyatonik Aug 16, 2019
4786ea7
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 16, 2019
e33fd0f
also remove keys from babe trait
svyatonik Aug 16, 2019
e7644e4
fixed warnings
svyatonik Aug 16, 2019
f70bbcc
Merge branch 'master' into fix_flaming_fir_light_sync
svyatonik Aug 16, 2019
89447ee
post-merge fixes
svyatonik Aug 16, 2019
320534d
reverted some redundant changes
svyatonik Aug 16, 2019
5bf8db9
reverted more changes
svyatonik Aug 16, 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
Merge branch 'master' into fix_flaming_fir_light_sync
  • Loading branch information
svyatonik committed Aug 8, 2019
commit b5e223e8a7fe2a83eac3ec6178e56c034d2d53e2
2 changes: 1 addition & 1 deletion core/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ fn epoch_from_cache<B, C>(client: &C, at: &BlockId<B>) -> Option<MaybeSpanEpoch>
client.cache()
.and_then(|cache| cache
.get_at(&well_known_cache_keys::EPOCH, at)
.and_then(|v| Decode::decode(&mut &v[..])))
.and_then(|v| Decode::decode(&mut &v[..]).ok()))
}

/// Extract current epoch from runtime.
Expand Down
6 changes: 3 additions & 3 deletions core/consensus/babe/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ fn authorities_call_works() {

assert_eq!(client.info().chain.best_number, 0);
assert_eq!(epoch(&client, &BlockId::Number(0)).unwrap().into_regular().unwrap().authorities, vec![
(Keyring::Alice.into(), 1),
(Keyring::Bob.into(), 1),
(Keyring::Charlie.into(), 1),
(Keyring::Alice.public().into(), 1),
(Keyring::Bob.public().into(), 1),
(Keyring::Charlie.public().into(), 1),
]);
}
4 changes: 3 additions & 1 deletion core/primitives/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
//! Cryptographic utilities.
// end::description[]

use rstd::convert::{TryFrom, TryInto};
use rstd::convert::TryFrom;
#[cfg(feature = "std")]
use rstd::convert::TryInto;
#[cfg(feature = "std")]
use parking_lot::Mutex;
#[cfg(feature = "std")]
Expand Down
8 changes: 4 additions & 4 deletions core/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub mod system;
use rstd::{prelude::*, marker::PhantomData};
use codec::{Encode, Decode, Input, Error};

use primitives::{Blake2Hasher, OpaqueMetadata};
use primitives::{Blake2Hasher, OpaqueMetadata, crypto::KeyTypeId};
use app_crypto::{ed25519, sr25519, RuntimeAppPublic};
pub use app_crypto;
use trie_db::{TrieMut, Trie};
Expand Down Expand Up @@ -396,11 +396,11 @@ impl srml_babe::Trait for Runtime {
pub struct DummyKeys;

impl OpaqueKeys for DummyKeys {
type KeyTypeIds = ::rstd::iter::Empty<u32>;
type KeyTypeIds = ::rstd::iter::Empty<KeyTypeId>;

fn key_ids() -> Self::KeyTypeIds { ::rstd::iter::empty() }
fn get_raw(&self, _: u32) -> &[u8] { unreachable!("never used") }
fn get<T: Decode>(&self, _: u32) -> Option<T> { None }
fn get_raw(&self, _: KeyTypeId) -> &[u8] { unreachable!("never used") }
fn get<T: Decode>(&self, _: KeyTypeId) -> Option<T> { None }
}

/// Adds one to the given input and returns the final result.
Expand Down
7 changes: 3 additions & 4 deletions node/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ mod tests {
let mut ext = TestExternalities::new_with_code_with_children(code, GenesisConfig {
babe: Some(BabeConfig {
authorities: vec![
(Sr25519Keyring::Dave.into(), 0),
(Sr25519Keyring::Eve.into(), 0),
(Sr25519Keyring::Ferdie.into(), 0),
(Sr25519Keyring::Dave.public().into(), 0),
(Sr25519Keyring::Eve.public().into(), 0),
(Sr25519Keyring::Ferdie.public().into(), 0),
]
}),
system: Some(SystemConfig {
Expand Down Expand Up @@ -390,7 +390,6 @@ mod tests {
current_schedule: Default::default(),
gas_price: 1 * MILLICENTS,
}),
babe: Some(Default::default()),
grandpa: Some(GrandpaConfig {
authorities: vec![],
}),
Expand Down
4 changes: 2 additions & 2 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to equal spec_version. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 130,
impl_version: 129,
spec_version: 136,
impl_version: 136,
apis: RUNTIME_API_VERSIONS,
};

Expand Down
4 changes: 2 additions & 2 deletions srml/babe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ system = { package = "srml-system", path = "../system", default-features = false
timestamp = { package = "srml-timestamp", path = "../timestamp", default-features = false }
session = { package = "srml-session", path = "../session", default-features = false }
babe-primitives = { package = "substrate-consensus-babe-primitives", path = "../../core/consensus/babe/primitives", default-features = false }
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false }
runtime_io = { package = "sr-io", path = "../../core/sr-io", default-features = false, features = [ "wasm-nice-panic-message" ] }
primitives = { package = "substrate-primitives", path = "../../core/primitives", default-features = false }

[dev-dependencies]
lazy_static = "1.3.0"
parking_lot = "0.8.0"
parking_lot = "0.9.0"

[features]
default = ["std"]
Expand Down
6 changes: 3 additions & 3 deletions srml/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ decl_storage! {
config: &GenesisConfig,
| {
use primitives::storage::well_known_keys;
use sr_primitives::traits::TypedKey;
use sr_primitives::AppKey;

runtime_io::with_storage(storage, || {
let mut authorities = config.authorities.clone();
Expand All @@ -209,7 +209,7 @@ decl_storage! {

let session_validators_keys_len = session_validators_keys.len();
for (idx, session_validator_keys) in session_validators_keys.into_iter().enumerate() {
let session_validator_key = session_validator_keys.1.get(AuthorityId::KEY_TYPE)
let session_validator_key = session_validator_keys.1.get(AuthorityId::ID)
.expect("Unable to get required key for BABE authority at genesis block");
let authority_position = authorities.iter().position(|(a, _)| *a == session_validator_key);
match authority_position {
Expand Down Expand Up @@ -346,7 +346,7 @@ impl<T: Trait> Module<T> {
.iter()
.filter_map(|s| s.as_pre_runtime())
.filter_map(|(id, mut data)| if id == BABE_ENGINE_ID {
RawBabePreDigest::decode(&mut data)
RawBabePreDigest::decode(&mut data).ok()
} else {
None
})
Expand Down
1 change: 1 addition & 0 deletions srml/membership/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ decl_storage! {
build(|
storage: &mut sr_primitives::StorageOverlay,
_: &mut sr_primitives::ChildrenStorageOverlay,
_: &mut sr_primitives::StorageOverlay,
config: &GenesisConfig<T, I>
| {
sr_io::with_storage(storage, || {
Expand Down
2 changes: 1 addition & 1 deletion srml/session/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ decl_storage! {
temp_storage: &mut sr_primitives::StorageOverlay,
config: &GenesisConfig<T>
| {
use parity_codec::Encode;
use codec::Encode;
use primitives::storage::well_known_keys;

runtime_io::with_storage(storage, || {
Expand Down
2 changes: 1 addition & 1 deletion srml/support/test/tests/genesisconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

pub trait Trait {
type BlockNumber: parity_codec::Codec + Default;
type BlockNumber: codec::Codec + Default;
type Origin;
}

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.