Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into bernhard-malus-fx
Browse files Browse the repository at this point in the history
* master:
  dependabot: ignore yet another git dep (#3759)
  Bump serde_json from 1.0.66 to 1.0.67 (#3767)
  Bump syn from 1.0.74 to 1.0.75 (#3710)
  Companion for substrate #9371 (#3487)
  Fixes/improvements for disputes (#3753)
  chore: test helper arbitrary ordering for 2 (#3762)
  disputes: fix relay chain selection sanity check (#3750)
  technical committee is using the weight of council, but should have its own generated weight instead (#3511)
  new proxy for auctions, crowdloans, registrar, slots (#3683)
  Bump libc from 0.2.100 to 0.2.101 (#3726)
  Removed unneeded deps (#3658)
  Bump serde from 1.0.127 to 1.0.130 (#3739)
  Companion for Generate storage info for pallet authority_discovery #9428 (#3517)
  Return a Result in invert_location (#3730)
  XCM: Allow reclaim of assets dropped from holding (#3727)
  • Loading branch information
ordian committed Sep 2, 2021
2 parents c3a8205 + 15f8e4a commit 7edc660
Show file tree
Hide file tree
Showing 86 changed files with 1,762 additions and 894 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ updates:
- dependency-name: "pallet-*"
- dependency-name: "beefy-*"
- dependency-name: "try-runtime-*"
- dependency-name: "test-runner"
schedule:
interval: "daily"
436 changes: 165 additions & 271 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions bridges/bin/millau/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,13 @@ impl frame_system::Config for Runtime {

impl pallet_randomness_collective_flip::Config for Runtime {}

parameter_types! {
pub const MaxAuthorities: u32 = 10;
}

impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type MaxAuthorities = MaxAuthorities;
}
impl pallet_bridge_dispatch::Config for Runtime {
type Event = Event;
Expand Down
5 changes: 5 additions & 0 deletions bridges/bin/rialto/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,13 @@ impl frame_system::Config for Runtime {

impl pallet_randomness_collective_flip::Config for Runtime {}

parameter_types! {
pub const MaxAuthorities: u32 = 10;
}

impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type MaxAuthorities = MaxAuthorities;
}

type RialtoPoA = pallet_bridge_eth_poa::Instance1;
Expand Down
6 changes: 3 additions & 3 deletions node/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ rococo-runtime = { path = "../../runtime/rococo", optional = true }
polkadot-primitives = { path = "../../primitives" }

[features]
kusama = [ "kusama-runtime" ]
rococo = [ "rococo-runtime" ]
westend = [ "westend-runtime" ]
kusama = ["kusama-runtime"]
rococo = ["rococo-runtime"]
westend = ["westend-runtime"]
6 changes: 1 addition & 5 deletions node/core/approval-voting/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,19 @@ polkadot-primitives = { path = "../../../primitives" }
polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-jaeger = { path = "../../jaeger" }

sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false, features = ["full_crypto"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }

[dev-dependencies]
parking_lot = "0.11.1"
rand_core = "0.5.1" # should match schnorrkel
rand_core = "0.5.1" # should match schnorrkel
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
maplit = "1.0.2"
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
assert_matches = "1.4.0"
kvdb-memorydb = "0.10.0"
rand = "0.8"
18 changes: 9 additions & 9 deletions node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1239,6 +1239,15 @@ async fn handle_approved_ancestor(
// ancestry is moving backwards.
all_approved_max = Some((block_hash, target_number - i as BlockNumber));
}
block_descriptions.push(BlockDescription {
block_hash,
session: entry.session(),
candidates: entry
.candidates()
.iter()
.map(|(_idx, candidate_hash)| *candidate_hash)
.collect(),
});
} else if bits.len() <= ABNORMAL_DEPTH_THRESHOLD {
all_approved_max = None;
block_descriptions.clear();
Expand Down Expand Up @@ -1321,15 +1330,6 @@ async fn handle_approved_ancestor(
}
}
}
block_descriptions.push(BlockDescription {
block_hash,
session: entry.session(),
candidates: entry
.candidates()
.iter()
.map(|(_idx, candidate_hash)| *candidate_hash)
.collect(),
});
}

tracing::trace!(
Expand Down
3 changes: 1 addition & 2 deletions node/core/dispute-coordinator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "maste

[dev-dependencies]
kvdb-memorydb = "0.10.0"
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers"}
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
assert_matches = "1.4.0"
polkadot-overseer = { path = "../../overseer" }

[features]
# If not enabled, the dispute coordinator will do nothing.
Expand Down
5 changes: 3 additions & 2 deletions node/core/dispute-coordinator/src/dummy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,14 @@ async fn handle_incoming(
},
DisputeCoordinatorMessage::IssueLocalStatement(_, _, _, _) => {},
DisputeCoordinatorMessage::DetermineUndisputedChain {
base_number,
base: (base_number, base_hash),
block_descriptions,
tx,
} => {
let undisputed_chain = block_descriptions
.last()
.map(|e| (base_number + block_descriptions.len() as BlockNumber, e.block_hash));
.map(|e| (base_number + block_descriptions.len() as BlockNumber, e.block_hash))
.unwrap_or((base_number, base_hash));

let _ = tx.send(undisputed_chain);
},
Expand Down
45 changes: 35 additions & 10 deletions node/core/dispute-coordinator/src/real/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,12 @@ async fn handle_incoming(
.await?;
},
DisputeCoordinatorMessage::DetermineUndisputedChain {
base_number,
base: (base_number, base_hash),
block_descriptions,
tx,
} => {
let undisputed_chain =
determine_undisputed_chain(overlay_db, base_number, block_descriptions)?;
determine_undisputed_chain(overlay_db, base_number, base_hash, block_descriptions)?;

let _ = tx.send(undisputed_chain);
},
Expand Down Expand Up @@ -907,7 +907,7 @@ async fn issue_local_statement(

// Do import
if !statements.is_empty() {
let (pending_confirmation, _rx) = oneshot::channel();
let (pending_confirmation, rx) = oneshot::channel();
handle_import_statements(
ctx,
overlay_db,
Expand All @@ -921,6 +921,32 @@ async fn issue_local_statement(
metrics,
)
.await?;
match rx.await {
Err(_) => {
tracing::error!(
target: LOG_TARGET,
?candidate_hash,
?session,
"pending confirmation receiver got dropped by `handle_import_statements` for our own votes!"
);
},
Ok(ImportStatementsResult::InvalidImport) => {
tracing::error!(
target: LOG_TARGET,
?candidate_hash,
?session,
"handle_import_statements` considers our own votes invalid!"
);
},
Ok(ImportStatementsResult::ValidImport) => {
tracing::trace!(
target: LOG_TARGET,
?candidate_hash,
?session,
"handle_import_statements` successfully imported our vote!"
);
},
}
}

Ok(())
Expand Down Expand Up @@ -996,11 +1022,13 @@ fn make_dispute_message(
fn determine_undisputed_chain(
overlay_db: &mut OverlayedBackend<'_, impl Backend>,
base_number: BlockNumber,
base_hash: Hash,
block_descriptions: Vec<BlockDescription>,
) -> Result<Option<(BlockNumber, Hash)>, Error> {
) -> Result<(BlockNumber, Hash), Error> {
let last = block_descriptions
.last()
.map(|e| (base_number + block_descriptions.len() as BlockNumber, e.block_hash));
.map(|e| (base_number + block_descriptions.len() as BlockNumber, e.block_hash))
.unwrap_or((base_number, base_hash));

// Fast path for no disputes.
let recent_disputes = match overlay_db.load_recent_disputes()? {
Expand All @@ -1018,12 +1046,9 @@ fn determine_undisputed_chain(
for (i, BlockDescription { session, candidates, .. }) in block_descriptions.iter().enumerate() {
if candidates.iter().any(|c| is_possibly_invalid(*session, *c)) {
if i == 0 {
return Ok(None)
return Ok((base_number, base_hash))
} else {
return Ok(Some((
base_number + i as BlockNumber,
block_descriptions[i - 1].block_hash,
)))
return Ok((base_number + i as BlockNumber, block_descriptions[i - 1].block_hash))
}
}
}
Expand Down
18 changes: 10 additions & 8 deletions node/core/dispute-coordinator/src/real/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,14 @@ fn finality_votes_ignore_disputed_candidates() {
{
let (tx, rx) = oneshot::channel();

let base_block = Hash::repeat_byte(0x0f);
let block_hash_a = Hash::repeat_byte(0x0a);
let block_hash_b = Hash::repeat_byte(0x0b);

virtual_overseer
.send(FromOverseer::Communication {
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
base_number: 10,
base: (10, base_block),
block_descriptions: vec![BlockDescription {
block_hash: block_hash_a,
session,
Expand All @@ -663,13 +664,13 @@ fn finality_votes_ignore_disputed_candidates() {
})
.await;

assert!(rx.await.unwrap().is_none());
assert_eq!(rx.await.unwrap(), (10, base_block));

let (tx, rx) = oneshot::channel();
virtual_overseer
.send(FromOverseer::Communication {
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
base_number: 10,
base: (10, base_block),
block_descriptions: vec![
BlockDescription {
block_hash: block_hash_a,
Expand All @@ -687,7 +688,7 @@ fn finality_votes_ignore_disputed_candidates() {
})
.await;

assert_eq!(rx.await.unwrap(), Some((11, block_hash_a)));
assert_eq!(rx.await.unwrap(), (11, block_hash_a));
}

virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
Expand Down Expand Up @@ -778,13 +779,14 @@ fn supermajority_valid_dispute_may_be_finalized() {
{
let (tx, rx) = oneshot::channel();

let base_hash = Hash::repeat_byte(0x0f);
let block_hash_a = Hash::repeat_byte(0x0a);
let block_hash_b = Hash::repeat_byte(0x0b);

virtual_overseer
.send(FromOverseer::Communication {
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
base_number: 10,
base: (10, base_hash),
block_descriptions: vec![BlockDescription {
block_hash: block_hash_a,
session,
Expand All @@ -795,13 +797,13 @@ fn supermajority_valid_dispute_may_be_finalized() {
})
.await;

assert_eq!(rx.await.unwrap(), Some((11, block_hash_a)));
assert_eq!(rx.await.unwrap(), (11, block_hash_a));

let (tx, rx) = oneshot::channel();
virtual_overseer
.send(FromOverseer::Communication {
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
base_number: 10,
base: (10, base_hash),
block_descriptions: vec![
BlockDescription {
block_hash: block_hash_a,
Expand All @@ -819,7 +821,7 @@ fn supermajority_valid_dispute_may_be_finalized() {
})
.await;

assert_eq!(rx.await.unwrap(), Some((12, block_hash_b)));
assert_eq!(rx.await.unwrap(), (12, block_hash_b));
}

virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
Expand Down
2 changes: 1 addition & 1 deletion node/core/pvf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async-process = "1.1.0"
assert_matches = "1.4.0"
futures = "0.3.15"
futures-timer = "3.0.2"
libc = "0.2.100"
libc = "0.2.101"
slotmap = "1.0"
tracing = "0.1.26"
pin-project = "1.0.8"
Expand Down
1 change: 0 additions & 1 deletion node/metered-channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ futures-timer = "3.0.2"
derive_more = "0.99"

[dev-dependencies]
assert_matches = "1.4.0"
futures = { version = "0.3.15", features = ["thread-pool"] }
7 changes: 1 addition & 6 deletions node/metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,11 @@ edition = "2018"
description = "Subsystem traits and message definitions"

[dependencies]
async-trait = "0.1.51"
futures = "0.3.15"
futures-timer = "3.0.2"

metered-channel = { path = "../metered-channel"}
metered-channel = { path = "../metered-channel" }

sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "master" }

jemalloc-ctl = { version = "0.3.3", optional = true }
Expand Down
7 changes: 2 additions & 5 deletions node/network/availability-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,14 @@ edition = "2018"
[dependencies]
futures = "0.3.15"
tracing = "0.1.26"
parity-scale-codec = { version = "2.0.0", features = ["std"] }
parity-scale-codec = { version = "2.0.0", features = ["std"] }
polkadot-primitives = { path = "../../../primitives" }
polkadot-erasure-coding = { path = "../../../erasure-coding" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
polkadot-node-network-protocol = { path = "../../network/protocol" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
polkadot-node-primitives = { path = "../../primitives" }
polkadot-node-core-runtime-api = { path = "../../core/runtime-api" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master", features = ["std"] }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
thiserror = "1.0.26"
rand = "0.8.3"
Expand All @@ -31,4 +29,3 @@ sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "master
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
futures-timer = "3.0.2"
assert_matches = "1.4.0"
maplit = "1.0"
2 changes: 1 addition & 1 deletion node/network/availability-recovery/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const COST_INVALID_REQUEST: Rep = Rep::CostMajor("Peer sent unparsable request")
#[cfg(not(test))]
const TIMEOUT_START_NEW_REQUESTS: Duration = CHUNK_REQUEST_TIMEOUT;
#[cfg(test)]
const TIMEOUT_START_NEW_REQUESTS: Duration = Duration::from_millis(4);
const TIMEOUT_START_NEW_REQUESTS: Duration = Duration::from_millis(10);

/// The Availability Recovery Subsystem.
pub struct AvailabilityRecoverySubsystem {
Expand Down
Loading

0 comments on commit 7edc660

Please sign in to comment.