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

Commit

Permalink
undo Arc proliferation from master merge
Browse files Browse the repository at this point in the history
If that was an intentional change, it'll need to be redone, because
it started to have huge effects all through the codebase; not something
I wanted to chase down right now.
  • Loading branch information
coriolinus committed Jul 9, 2020
1 parent 3eaf94b commit 004a695
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
9 changes: 4 additions & 5 deletions node/core/backing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#![recursion_limit="256"]

use std::sync::Arc;
use std::collections::{HashMap, HashSet};
use std::convert::TryFrom;
use std::pin::Pin;
Expand Down Expand Up @@ -234,7 +233,7 @@ impl CandidateBackingJob {
async fn validate_and_second(
&mut self,
candidate: AbridgedCandidateReceipt,
pov: Arc<PoVBlock>,
pov: PoVBlock,
) -> Result<ValidationResult, Error> {
let (valid, global_validation_schedule, local_validation_data) = self.request_candidate_validation(candidate.clone(), pov.clone()).await?;
let statement = match valid {
Expand Down Expand Up @@ -454,7 +453,7 @@ impl CandidateBackingJob {
async fn request_pov_from_distribution(
&mut self,
descriptor: CandidateDescriptor,
) -> Result<Arc<PoVBlock>, Error> {
) -> Result<PoVBlock, Error> {
let (tx, rx) = oneshot::channel();

self.tx_from.send(FromJob::PoVDistribution(
Expand All @@ -467,7 +466,7 @@ impl CandidateBackingJob {
async fn request_candidate_validation(
&mut self,
candidate: AbridgedCandidateReceipt,
pov: Arc<PoVBlock>,
pov: PoVBlock,
) -> Result<(ValidationResult, GlobalValidationSchedule, LocalValidationData), Error> {
let (tx, rx) = oneshot::channel();

Expand Down Expand Up @@ -500,7 +499,7 @@ impl CandidateBackingJob {

async fn make_pov_available(
&mut self,
pov_block: Arc<PoVBlock>,
pov_block: PoVBlock,
global_validation: GlobalValidationSchedule,
local_validation: LocalValidationData,
) -> Result<(), Error> {
Expand Down
10 changes: 4 additions & 6 deletions node/subsystem/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ use polkadot_node_primitives::{
MisbehaviorReport, SignedFullStatement, View, ProtocolId, ValidationResult,
};

use std::sync::Arc;

pub use sc_network::{ObservedRole, ReputationChange, PeerId};

/// A notification of a new backed candidate.
Expand All @@ -59,7 +57,7 @@ pub enum CandidateBackingMessage {
RegisterBackingWatcher(Hash, mpsc::Sender<NewBackedCandidate>),
/// Note that the Candidate Backing subsystem should second the given candidate in the context of the
/// given relay-parent (ref. by hash). This candidate must be validated.
Second(Hash, AbridgedCandidateReceipt, Arc<PoVBlock>),
Second(Hash, AbridgedCandidateReceipt, PoVBlock),
/// Note a validator's statement about a particular candidate. Disagreements about validity must be escalated
/// to a broader check by Misbehavior Arbitration. Agreements are simply tallied until a quorum is reached.
Statement(Hash, SignedFullStatement),
Expand All @@ -80,7 +78,7 @@ pub enum CandidateValidationMessage {
Hash,
AbridgedCandidateReceipt,
HeadData,
Arc<PoVBlock>,
PoVBlock,
oneshot::Sender<Result<
(ValidationResult, GlobalValidationSchedule, LocalValidationData),
ValidationFailed,
Expand Down Expand Up @@ -253,10 +251,10 @@ pub enum PoVDistributionMessage {
///
/// This `CandidateDescriptor` should correspond to a candidate seconded under the provided
/// relay-parent hash.
FetchPoV(Hash, CandidateDescriptor, oneshot::Sender<Arc<PoVBlock>>),
FetchPoV(Hash, CandidateDescriptor, oneshot::Sender<PoVBlock>),
/// Distribute a PoV for the given relay-parent and CandidateDescriptor.
/// The PoV should correctly hash to the PoV hash mentioned in the CandidateDescriptor
DistributePoV(Hash, CandidateDescriptor, Arc<PoVBlock>),
DistributePoV(Hash, CandidateDescriptor, PoVBlock),
/// An update from the network bridge.
NetworkBridgeUpdate(NetworkBridgeEvent),
}
Expand Down
3 changes: 1 addition & 2 deletions primitives/src/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

use sp_std::prelude::*;
use sp_std::cmp::Ordering;
use sp_std::sync::Arc;
use parity_scale_codec::{Encode, Decode};
use bitvec::vec::BitVec;
use super::{Hash, Balance, BlockNumber};
Expand Down Expand Up @@ -719,7 +718,7 @@ impl PoVBlock {
#[cfg_attr(feature = "std", derive(Debug, Encode, Decode))]
pub struct AvailableData {
/// The PoV block.
pub pov_block: Arc<PoVBlock>,
pub pov_block: PoVBlock,
/// Data that is omitted from an abridged candidate receipt
/// that is necessary for validation.
pub omitted_validation: OmittedValidationData,
Expand Down

0 comments on commit 004a695

Please sign in to comment.