diff --git a/substrate/core/client/src/light/call_executor.rs b/substrate/core/client/src/light/call_executor.rs index 47c11b93fa..8f90aaf54e 100644 --- a/substrate/core/client/src/light/call_executor.rs +++ b/substrate/core/client/src/light/call_executor.rs @@ -148,7 +148,7 @@ where } fn runtime_version(&self, id: &BlockId) -> ClientResult { - let call_result = self.call(id, "version", &[], ExecutionStrategy::NativeElseWasm, NeverOffchainExt::new())?; + let call_result = self.call(id, "Core_version", &[], ExecutionStrategy::NativeElseWasm, NeverOffchainExt::new())?; RuntimeVersion::decode(&mut call_result.as_slice()) .ok_or_else(|| ClientError::VersionInvalid.into()) } diff --git a/substrate/core/network/src/consensus_gossip.rs b/substrate/core/network/src/consensus_gossip.rs index 668b30de79..95753c54a7 100644 --- a/substrate/core/network/src/consensus_gossip.rs +++ b/substrate/core/network/src/consensus_gossip.rs @@ -265,6 +265,11 @@ impl ConsensusGossip { /// Handle new connected peer. pub fn new_peer(&mut self, protocol: &mut Context, who: PeerId, roles: Roles) { + // light nodes are not valid targets for consensus gossip messages + if !roles.intersects(Roles::FULL | Roles::AUTHORITY) { + return; + } + trace!(target:"gossip", "Registering {:?} {}", roles, who); self.peers.insert(who.clone(), PeerConsensus { known_messages: HashSet::new(), diff --git a/substrate/core/network/src/protocol.rs b/substrate/core/network/src/protocol.rs index dd3b759949..a907a3052d 100644 --- a/substrate/core/network/src/protocol.rs +++ b/substrate/core/network/src/protocol.rs @@ -72,10 +72,6 @@ const UNEXPECTED_STATUS_REPUTATION_CHANGE: i32 = -(1 << 20); const PEER_BEHIND_US_LIGHT_REPUTATION_CHANGE: i32 = -(1 << 8); /// Reputation change when a peer sends us an extrinsic that we didn't know about. const NEW_EXTRINSIC_REPUTATION_CHANGE: i32 = 1 << 7; -/// Reputation change when a peer sends us a block. We don't know whether this block is valid or -/// already known to us. Since this has a small cost, we decrease the reputation of the node, and -/// will increase it back later if the import is successful. -const BLOCK_ANNOUNCE_REPUTATION_CHANGE: i32 = -(1 << 2); /// We sent an RPC query to the given node, but it failed. const RPC_FAILED_REPUTATION_CHANGE: i32 = -(1 << 12); @@ -991,7 +987,6 @@ impl, H: ExHashT> Protocol { hash, &header, ); - self.network_chan.send(NetworkMsg::ReportPeer(who, BLOCK_ANNOUNCE_REPUTATION_CHANGE)); } fn on_block_imported(&mut self, hash: B::Hash, header: &B::Header) {