mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
depend-o-pocalipse (#9450)
Remove unneeded dependencies and dev-dependencies. Made self_destruct test not dependent on wasm bin size. Updated code related to deprecated warning on tracing-subscriber `scope()` ( See https://github.com/tokio-rs/tracing/issues/1429 )
This commit is contained in:
@@ -20,13 +20,13 @@ prost-build = "0.7"
|
||||
async-trait = "0.1"
|
||||
async-std = "1.6.5"
|
||||
bitflags = "1.2.0"
|
||||
bs58 = "0.4.0"
|
||||
cid = "0.6.0"
|
||||
bytes = "1"
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", features = [
|
||||
"derive",
|
||||
] }
|
||||
derive_more = "0.99.2"
|
||||
either = "1.5.3"
|
||||
erased-serde = "0.3.9"
|
||||
fnv = "1.0.6"
|
||||
fork-tree = { version = "3.0.0", path = "../../utils/fork-tree" }
|
||||
futures = "0.3.9"
|
||||
@@ -38,7 +38,6 @@ linked-hash-map = "0.5.4"
|
||||
linked_hash_set = "0.1.3"
|
||||
lru = "0.6.5"
|
||||
log = "0.4.8"
|
||||
nohash-hasher = "0.2.0"
|
||||
parking_lot = "0.11.1"
|
||||
pin-project = "1.0.4"
|
||||
prometheus-endpoint = { package = "substrate-prometheus-endpoint", version = "0.9.0", path = "../../utils/prometheus" }
|
||||
@@ -59,7 +58,10 @@ sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" }
|
||||
sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" }
|
||||
sp-finality-grandpa = { version = "4.0.0-dev", path = "../../primitives/finality-grandpa" }
|
||||
thiserror = "1"
|
||||
unsigned-varint = { version = "0.6.0", features = ["futures", "asynchronous_codec"] }
|
||||
unsigned-varint = { version = "0.6.0", features = [
|
||||
"futures",
|
||||
"asynchronous_codec",
|
||||
] }
|
||||
void = "1.0.2"
|
||||
wasm-timer = "0.2"
|
||||
zeroize = "1.2.0"
|
||||
@@ -70,7 +72,18 @@ version = "0.37.1"
|
||||
[target.'cfg(target_os = "unknown")'.dependencies.libp2p]
|
||||
version = "0.37.1"
|
||||
default-features = false
|
||||
features = ["identify", "kad", "mdns", "mplex", "noise", "ping", "request-response", "tcp-async-io", "websocket", "yamux"]
|
||||
features = [
|
||||
"identify",
|
||||
"kad",
|
||||
"mdns",
|
||||
"mplex",
|
||||
"noise",
|
||||
"ping",
|
||||
"request-response",
|
||||
"tcp-async-io",
|
||||
"websocket",
|
||||
"yamux",
|
||||
]
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -78,7 +91,6 @@ assert_matches = "1.3"
|
||||
libp2p = { version = "0.37.1", default-features = false }
|
||||
quickcheck = "1.0.3"
|
||||
rand = "0.7.2"
|
||||
sp-keyring = { version = "4.0.0-dev", path = "../../primitives/keyring" }
|
||||
sp-test-primitives = { version = "2.0.0", path = "../../primitives/test-primitives" }
|
||||
sp-tracing = { version = "4.0.0-dev", path = "../../primitives/tracing" }
|
||||
substrate-test-runtime = { version = "2.0.0", path = "../../test-utils/runtime" }
|
||||
|
||||
@@ -213,14 +213,15 @@ where
|
||||
) -> Result<Reply<B>, Error> {
|
||||
use schema::v1::light::response::Response;
|
||||
match response.response {
|
||||
Some(Response::RemoteCallResponse(response)) =>
|
||||
Some(Response::RemoteCallResponse(response)) => {
|
||||
if let Request::Call { request, .. } = request {
|
||||
let proof = Decode::decode(&mut response.proof.as_ref())?;
|
||||
let reply = self.checker.check_execution_proof(request, proof)?;
|
||||
Ok(Reply::VecU8(reply))
|
||||
} else {
|
||||
Err(Error::UnexpectedResponse)
|
||||
},
|
||||
}
|
||||
},
|
||||
Some(Response::RemoteReadResponse(response)) => match request {
|
||||
Request::Read { request, .. } => {
|
||||
let proof = Decode::decode(&mut response.proof.as_ref())?;
|
||||
@@ -234,7 +235,7 @@ where
|
||||
},
|
||||
_ => Err(Error::UnexpectedResponse),
|
||||
},
|
||||
Some(Response::RemoteChangesResponse(response)) =>
|
||||
Some(Response::RemoteChangesResponse(response)) => {
|
||||
if let Request::Changes { request, .. } = request {
|
||||
let max_block = Decode::decode(&mut response.max.as_ref())?;
|
||||
let roots_proof = Decode::decode(&mut response.roots_proof.as_ref())?;
|
||||
@@ -259,8 +260,9 @@ where
|
||||
Ok(Reply::VecNumberU32(reply))
|
||||
} else {
|
||||
Err(Error::UnexpectedResponse)
|
||||
},
|
||||
Some(Response::RemoteHeaderResponse(response)) =>
|
||||
}
|
||||
},
|
||||
Some(Response::RemoteHeaderResponse(response)) => {
|
||||
if let Request::Header { request, .. } = request {
|
||||
let header = if response.header.is_empty() {
|
||||
None
|
||||
@@ -272,7 +274,8 @@ where
|
||||
Ok(Reply::Header(reply))
|
||||
} else {
|
||||
Err(Error::UnexpectedResponse)
|
||||
},
|
||||
}
|
||||
},
|
||||
None => Err(Error::UnexpectedResponse),
|
||||
}
|
||||
}
|
||||
@@ -779,8 +782,9 @@ impl<B: Block> Request<B> {
|
||||
Request::Header { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
Ok(Reply::Header(x)) => send(Ok(x), sender),
|
||||
reply =>
|
||||
log::error!("invalid reply for header request: {:?}, {:?}", reply, request),
|
||||
reply => {
|
||||
log::error!("invalid reply for header request: {:?}, {:?}", reply, request)
|
||||
},
|
||||
},
|
||||
Request::Read { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
@@ -790,8 +794,9 @@ impl<B: Block> Request<B> {
|
||||
Request::ReadChild { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
Ok(Reply::MapVecU8OptVecU8(x)) => send(Ok(x), sender),
|
||||
reply =>
|
||||
log::error!("invalid reply for read child request: {:?}, {:?}", reply, request),
|
||||
reply => {
|
||||
log::error!("invalid reply for read child request: {:?}, {:?}", reply, request)
|
||||
},
|
||||
},
|
||||
Request::Call { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
@@ -801,8 +806,9 @@ impl<B: Block> Request<B> {
|
||||
Request::Changes { request, sender } => match result {
|
||||
Err(e) => send(Err(e), sender),
|
||||
Ok(Reply::VecNumberU32(x)) => send(Ok(x), sender),
|
||||
reply =>
|
||||
log::error!("invalid reply for changes request: {:?}, {:?}", reply, request),
|
||||
reply => {
|
||||
log::error!("invalid reply for changes request: {:?}, {:?}", reply, request)
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -352,8 +352,9 @@ impl NetworkBehaviour for PeerInfoBehaviour {
|
||||
let event = PeerInfoEvent::Identified { peer_id, info };
|
||||
return Poll::Ready(NetworkBehaviourAction::GenerateEvent(event))
|
||||
},
|
||||
IdentifyEvent::Error { peer_id, error } =>
|
||||
debug!(target: "sub-libp2p", "Identification with peer {:?} failed => {}", peer_id, error),
|
||||
IdentifyEvent::Error { peer_id, error } => {
|
||||
debug!(target: "sub-libp2p", "Identification with peer {:?} failed => {}", peer_id, error)
|
||||
},
|
||||
IdentifyEvent::Pushed { .. } => {},
|
||||
IdentifyEvent::Sent { .. } => {},
|
||||
},
|
||||
|
||||
@@ -565,8 +565,9 @@ impl Notifications {
|
||||
*entry.into_mut() = PeerState::Disabled { connections, backoff_until }
|
||||
},
|
||||
|
||||
PeerState::Poisoned =>
|
||||
error!(target: "sub-libp2p", "State of {:?} is poisoned", peer_id),
|
||||
PeerState::Poisoned => {
|
||||
error!(target: "sub-libp2p", "State of {:?} is poisoned", peer_id)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ where
|
||||
|
||||
loop {
|
||||
match mem::replace(this.handshake, NotificationsInSubstreamHandshake::Sent) {
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) =>
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) => {
|
||||
match Sink::poll_ready(this.socket.as_mut(), cx) {
|
||||
Poll::Ready(_) => {
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
@@ -231,8 +231,9 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::PendingSend(msg);
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush =>
|
||||
}
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush => {
|
||||
match Sink::poll_flush(this.socket.as_mut(), cx)? {
|
||||
Poll::Ready(()) =>
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Sent,
|
||||
@@ -240,7 +241,8 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
st @ NotificationsInSubstreamHandshake::NotSent |
|
||||
st @ NotificationsInSubstreamHandshake::Sent |
|
||||
@@ -270,7 +272,7 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::NotSent;
|
||||
return Poll::Pending
|
||||
},
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) =>
|
||||
NotificationsInSubstreamHandshake::PendingSend(msg) => {
|
||||
match Sink::poll_ready(this.socket.as_mut(), cx) {
|
||||
Poll::Ready(_) => {
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
@@ -283,8 +285,9 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::PendingSend(msg);
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush =>
|
||||
}
|
||||
},
|
||||
NotificationsInSubstreamHandshake::Flush => {
|
||||
match Sink::poll_flush(this.socket.as_mut(), cx)? {
|
||||
Poll::Ready(()) =>
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Sent,
|
||||
@@ -292,7 +295,8 @@ where
|
||||
*this.handshake = NotificationsInSubstreamHandshake::Flush;
|
||||
return Poll::Pending
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
NotificationsInSubstreamHandshake::Sent => {
|
||||
match Stream::poll_next(this.socket.as_mut(), cx) {
|
||||
|
||||
@@ -1967,8 +1967,9 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
|
||||
}
|
||||
}
|
||||
},
|
||||
Poll::Ready(SwarmEvent::Dialing(peer_id)) =>
|
||||
trace!(target: "sub-libp2p", "Libp2p => Dialing({:?})", peer_id),
|
||||
Poll::Ready(SwarmEvent::Dialing(peer_id)) => {
|
||||
trace!(target: "sub-libp2p", "Libp2p => Dialing({:?})", peer_id)
|
||||
},
|
||||
Poll::Ready(SwarmEvent::IncomingConnection { local_addr, send_back_addr }) => {
|
||||
trace!(target: "sub-libp2p", "Libp2p => IncomingConnection({},{}))",
|
||||
local_addr, send_back_addr);
|
||||
@@ -2007,9 +2008,10 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
|
||||
.inc();
|
||||
}
|
||||
},
|
||||
Poll::Ready(SwarmEvent::UnknownPeerUnreachableAddr { address, error }) =>
|
||||
Poll::Ready(SwarmEvent::UnknownPeerUnreachableAddr { address, error }) => {
|
||||
trace!(target: "sub-libp2p", "Libp2p => UnknownPeerUnreachableAddr({}): {}",
|
||||
address, error),
|
||||
address, error)
|
||||
},
|
||||
Poll::Ready(SwarmEvent::ListenerClosed { reason, addresses }) => {
|
||||
if let Some(metrics) = this.metrics.as_ref() {
|
||||
metrics.listeners_local_addresses.sub(addresses.len() as u64);
|
||||
|
||||
@@ -135,8 +135,9 @@ impl<TBlock: BlockT> RequestHandler<TBlock> {
|
||||
let IncomingRequest { peer, payload, pending_response } = request;
|
||||
|
||||
match self.handle_request(payload, pending_response) {
|
||||
Ok(()) =>
|
||||
debug!(target: "sync", "Handled grandpa warp sync request from {}.", peer),
|
||||
Ok(()) => {
|
||||
debug!(target: "sync", "Handled grandpa warp sync request from {}.", peer)
|
||||
},
|
||||
Err(e) => debug!(
|
||||
target: "sync",
|
||||
"Failed to handle grandpa warp sync request from {}: {}",
|
||||
|
||||
@@ -31,7 +31,6 @@ sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" }
|
||||
sp-consensus-babe = { version = "0.10.0-dev", path = "../../../primitives/consensus/babe" }
|
||||
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }
|
||||
substrate-test-runtime = { version = "2.0.0", path = "../../../test-utils/runtime" }
|
||||
tempfile = "3.1.0"
|
||||
sp-tracing = { version = "4.0.0-dev", path = "../../../primitives/tracing" }
|
||||
sc-service = { version = "0.10.0-dev", default-features = false, features = ["test-helpers"], path = "../../service" }
|
||||
async-trait = "0.1.50"
|
||||
|
||||
Reference in New Issue
Block a user