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
37 commits
Select commit Hold shift + click to select a range
3517a80
babe: secondary blocks with VRF
sorpaas Apr 2, 2020
ae38673
Fix node runtime compile
sorpaas Apr 2, 2020
13aa495
Fix test-utils runtime interface
sorpaas Apr 2, 2020
c264025
Fix babe tests
sorpaas Apr 2, 2020
936253c
typo: v == 2
sorpaas Apr 3, 2020
5383f4d
babe: support online configuration upgrades
sorpaas Apr 3, 2020
2c91a14
Fix rpc tests
sorpaas Apr 3, 2020
06adbb9
Fix runtime version tests
sorpaas Apr 3, 2020
c1b502c
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Apr 3, 2020
8185b91
Switch to use NextConfigDescriptor instead of changing runtime interface
sorpaas Apr 7, 2020
e9c57dd
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Apr 7, 2020
559b895
Fix tests
sorpaas Apr 7, 2020
9402233
Merge branch 'master' into sp-epoch-config
sorpaas Apr 8, 2020
682e3b7
epoch-changes: map function that allows converting with different epo…
sorpaas Apr 8, 2020
fc8d9fe
Add migration script for the epoch config change
sorpaas Apr 8, 2020
7a65f26
Merge branch 'sp-epoch-config' of https://github.com/paritytech/subst…
sorpaas Apr 8, 2020
9a23a79
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Apr 19, 2020
0c52d85
Fix docs for PrimaryAndSecondaryVRFSlots
sorpaas Apr 19, 2020
6a032b8
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Apr 20, 2020
d978b67
Merge branch 'master' into sp-epoch-config
sorpaas Apr 20, 2020
d825d45
Add docs of `SecondaryVRF` in babe crate
sorpaas Apr 20, 2020
df540a4
babe-primitives: Secondary -> SecondaryPlain
sorpaas Apr 20, 2020
42360ec
babe-client: Secondary -> SecondaryPlain
sorpaas Apr 20, 2020
5144e80
Fix migration tests
sorpaas Apr 20, 2020
bd102bc
Merge branch 'sp-epoch-config' of https://github.com/paritytech/subst…
sorpaas Apr 20, 2020
e049b81
test-utils-runtime: Secondary -> SecondaryPlain
sorpaas Apr 20, 2020
904df04
Fix missing name change in test-utils-runtime
sorpaas Apr 20, 2020
abba6a5
Fix migration: Epoch should be EpochV0
sorpaas Apr 20, 2020
ee72297
Update client/consensus/babe/src/lib.rs
sorpaas Apr 20, 2020
52bc6f9
Fix new epochChanges version
sorpaas Apr 20, 2020
60f4f80
Merge branch 'sp-epoch-config' of https://github.com/paritytech/subst…
sorpaas Apr 20, 2020
4e9490d
Merge branch 'sp-epoch-config' into sp-aura-vrf
sorpaas Apr 20, 2020
3b889a3
Fix babe-primitives naming changes
sorpaas Apr 20, 2020
6cf220a
Fix merge issues in babe-client
sorpaas Apr 20, 2020
2d1295e
Merge branch 'master' of https://github.com/paritytech/substrate into…
sorpaas Apr 23, 2020
4c12ea8
Merge branch 'master' into sp-aura-vrf
andresilva Apr 24, 2020
b2e9eba
Merge branch 'master' into sp-aura-vrf
andresilva Apr 24, 2020
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
Fix merge issues in babe-client
  • Loading branch information
sorpaas committed Apr 20, 2020
commit 6cf220ae8310abbf4dc013fa96503a2cb03786b8
6 changes: 3 additions & 3 deletions client/consensus/babe/src/authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ pub fn claim_slot(
) -> Option<(PreDigest, AuthorityPair)> {
claim_primary_slot(slot_number, epoch, epoch.config.c, keystore)
.or_else(|| {
if config.allowed_slots.is_secondary_plain_slots_allowed() ||
config.allowed_slots.is_secondary_vrf_slots_allowed()
if epoch.config.allowed_slots.is_secondary_plain_slots_allowed() ||
epoch.config.allowed_slots.is_secondary_vrf_slots_allowed()
{
claim_secondary_slot(
slot_number,
&epoch,
keystore,
config.allowed_slots.is_secondary_vrf_slots_allowed(),
epoch.config.allowed_slots.is_secondary_vrf_slots_allowed(),
)
} else {
None
Expand Down
6 changes: 3 additions & 3 deletions client/consensus/babe/src/aux_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ pub(crate) fn load_block_weight<H: Encode, B: AuxStore>(
#[cfg(test)]
mod test {
use super::*;
use crate::{Epoch, migration::EpochV0};
use crate::migration::EpochV0;
use fork_tree::ForkTree;
use substrate_test_runtime_client;
use sp_core::H256;
use sp_runtime::traits::NumberFor;
use sp_consensus_babe::{BabeEpochConfiguration, BabeGenesisConfiguration};
use sp_consensus_babe::{AllowedSlots, BabeGenesisConfiguration};
use sc_consensus_epochs::{PersistedEpoch, PersistedEpochHeader, EpochHeader};
use sp_consensus::Error as ConsensusError;
use sc_network_test::Block as TestBlock;
Expand Down Expand Up @@ -182,7 +182,7 @@ mod test {
c: (3, 10),
genesis_authorities: Vec::new(),
randomness: Default::default(),
secondary_slots: true,
allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots,
},
).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl Epoch {
randomness: genesis_config.randomness.clone(),
config: BabeEpochConfiguration {
c: genesis_config.c,
secondary_slots: genesis_config.secondary_slots,
allowed_slots: genesis_config.allowed_slots,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl EpochV0 {
randomness: self.randomness,
config: BabeEpochConfiguration {
c: config.c,
secondary_slots: config.secondary_slots,
allowed_slots: config.allowed_slots,
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/consensus/babe/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ fn can_author_block() {
duration: 100,
config: BabeEpochConfiguration {
c: (3, 10),
secondary_slots: true,
allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots,
},
};

Expand Down
4 changes: 2 additions & 2 deletions client/consensus/babe/src/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub(super) fn check_header<B: BlockT + Sized>(
epoch.config.c,
)?;
},
PreDigest::SecondaryPlain(secondary) if config.allowed_slots.is_secondary_plain_slots_allowed() => {
PreDigest::SecondaryPlain(secondary) if epoch.config.allowed_slots.is_secondary_plain_slots_allowed() => {
debug!(target: "babe", "Verifying Secondary plain block");
check_secondary_plain_header::<B>(
pre_hash,
Expand All @@ -112,7 +112,7 @@ pub(super) fn check_header<B: BlockT + Sized>(
&epoch,
)?;
},
PreDigest::SecondaryVRF(secondary) if config.allowed_slots.is_secondary_vrf_slots_allowed() => {
PreDigest::SecondaryVRF(secondary) if epoch.config.allowed_slots.is_secondary_vrf_slots_allowed() => {
debug!(target: "babe", "Verifying Secondary VRF block");
check_secondary_vrf_header::<B>(
pre_hash,
Expand Down
2 changes: 1 addition & 1 deletion primitives/consensus/babe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub enum AllowedSlots {

impl AllowedSlots {
/// Whether plain secondary slots are allowed.
pub fn is_secondary_slots_allowed(&self) -> bool {
pub fn is_secondary_plain_slots_allowed(&self) -> bool {
*self == Self::PrimaryAndSecondaryPlainSlots
}

Expand Down