Update to latest Substrate master (#320)

* Make `collator::Network` require `Send + Sync` to make it work

* Update packages

* Update to latest Substrate

* Make it compile and make tests work

* Use `polkadot-master`

* Fix CI

* Remove `build.sh` from readmes

* Delete old stuff

* Bring one back
This commit is contained in:
Bastian Köcher
2019-07-09 16:33:49 +02:00
committed by André Silva
parent d99f721540
commit c0b065837e
28 changed files with 728 additions and 4717 deletions
+11 -19
View File
@@ -33,9 +33,8 @@ use polkadot_primitives::parachain::{
StructuredUnroutedIngress,
};
use substrate_network::{
PeerId, RequestId, Context, Event, message, generic_message,
specialization::NetworkSpecialization as Specialization,
StatusMessage as GenericFullStatus
PeerId, RequestId, Context, StatusMessage as GenericFullStatus,
specialization::{Event, NetworkSpecialization as Specialization},
};
use self::validation::{LiveValidationSessions, RecentValidatorIds, InsertedRecentKey};
use self::collator_pool::{CollatorPool, Role, Action};
@@ -573,24 +572,17 @@ impl Specialization<Block> for PolkadotProtocol {
&mut self,
ctx: &mut dyn Context<Block>,
who: PeerId,
message: &mut Option<message::Message<Block>>
message: Vec<u8>,
) {
match message.take() {
Some(generic_message::Message::ChainSpecific(raw)) => {
match Message::decode(&mut raw.as_slice()) {
Some(msg) => {
ctx.report_peer(who.clone(), benefit::VALID_FORMAT);
self.on_polkadot_message(ctx, who, msg)
},
None => {
trace!(target: "p_net", "Bad message from {}", who);
ctx.report_peer(who, cost::INVALID_FORMAT);
*message = Some(generic_message::Message::ChainSpecific(raw));
}
}
match Message::decode(&mut &message[..]) {
Some(msg) => {
ctx.report_peer(who.clone(), benefit::VALID_FORMAT);
self.on_polkadot_message(ctx, who, msg)
},
None => {
trace!(target: "p_net", "Bad message from {}", who);
ctx.report_peer(who, cost::INVALID_FORMAT);
}
Some(other) => *message = Some(other),
_ => {}
}
}