Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
5bf9dd2a
Unverified
Commit
5bf9dd2a
authored
3 months ago
by
Andrei Eres
Browse files
Options
Downloads
Patches
Plain Diff
Implement NetworkRequest for litep2p
parent
1059be75
Branches
gh-readonly-queue/master/pr-7068-baa3bcc60ddab6a700a713e241ad6599feb046dd
Branches containing commit
No related merge requests found
Pipeline
#510847
waiting for manual action with stages
in 33 minutes and 8 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/client/network/src/litep2p/service.rs
+18
-8
18 additions, 8 deletions
substrate/client/network/src/litep2p/service.rs
with
18 additions
and
8 deletions
substrate/client/network/src/litep2p/service.rs
+
18
−
8
View file @
5bf9dd2a
...
...
@@ -28,8 +28,8 @@ use crate::{
peer_store
::
PeerStoreProvider
,
service
::
out_events
,
Event
,
IfDisconnected
,
NetworkDHTProvider
,
NetworkEventStream
,
NetworkPeers
,
NetworkRequest
,
NetworkSigner
,
NetworkStateInfo
,
NetworkStatus
,
NetworkStatusProvider
,
ProtocolNam
e
,
RequestFailure
,
Signature
,
NetworkSigner
,
NetworkStateInfo
,
NetworkStatus
,
NetworkStatusProvider
,
OutboundFailur
e
,
ProtocolName
,
RequestFailure
,
Signature
,
};
use
codec
::
DecodeAll
;
...
...
@@ -526,13 +526,23 @@ impl NetworkStateInfo for Litep2pNetworkService {
impl
NetworkRequest
for
Litep2pNetworkService
{
async
fn
request
(
&
self
,
_
target
:
PeerId
,
_
protocol
:
ProtocolName
,
_
request
:
Vec
<
u8
>
,
_
fallback_request
:
Option
<
(
Vec
<
u8
>
,
ProtocolName
)
>
,
_
connect
:
IfDisconnected
,
target
:
PeerId
,
protocol
:
ProtocolName
,
request
:
Vec
<
u8
>
,
fallback_request
:
Option
<
(
Vec
<
u8
>
,
ProtocolName
)
>
,
connect
:
IfDisconnected
,
)
->
Result
<
(
Vec
<
u8
>
,
ProtocolName
),
RequestFailure
>
{
unimplemented!
();
let
(
tx
,
rx
)
=
oneshot
::
channel
();
self
.start_request
(
target
,
protocol
,
request
,
fallback_request
,
tx
,
connect
);
match
rx
.await
{
Ok
(
v
)
=>
v
,
// The channel can only be closed if the network worker no longer exists. If the
// network worker no longer exists, then all connections to `target` are necessarily
// closed, and we legitimately report this situation as a "ConnectionClosed".
Err
(
_
)
=>
Err
(
RequestFailure
::
Network
(
OutboundFailure
::
ConnectionClosed
)),
}
}
fn
start_request
(
...
...
This diff is collapsed.
Click to expand it.
Paritytech CI
@paritytech-ci
mentioned in commit
be20c657
·
3 months ago
mentioned in commit
be20c657
mentioned in commit be20c65743cefdaa5a3bfb29c2fc668fc57d8925
Toggle commit list
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment