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
d10404dc
Commit
d10404dc
authored
4 years ago
by
Pierre Krieger
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Remove hack around secondary connections handshakes (#7246)
parent
a31637de
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
substrate/client/network/src/protocol/generic_proto/behaviour.rs
+0
-19
0 additions, 19 deletions
...te/client/network/src/protocol/generic_proto/behaviour.rs
with
0 additions
and
19 deletions
substrate/client/network/src/protocol/generic_proto/behaviour.rs
+
0
−
19
View file @
d10404dc
...
...
@@ -1312,30 +1312,11 @@ impl NetworkBehaviour for GenericProto {
self
.events
.push_back
(
NetworkBehaviourAction
::
GenerateEvent
(
event
));
}
else
{
// In normal situations, the handshake is supposed to be a Status message, and
// we would discard Status messages received from secondary connections.
// However, in Polkadot 0.8.10 and below, nodes don't send a Status message
// when opening secondary connections and instead directly consider the
// substream as open. When connecting to such a node, the first message sent
// by the remote will always be considered by our local node as the handshake,
// even when it is a regular message.
// In order to maintain backwards compatibility, we therefore report the
// handshake as if it was a regular message, and the upper layer will ignore
// any superfluous Status message.
// The code below should be removed once Polkadot 0.8.10 and below are no
// longer widely in use, and should be replaced with simply printing a log
// entry.
debug!
(
target
:
"sub-libp2p"
,
"Handler({:?}) => Secondary connection opened custom protocol"
,
source
);
trace!
(
target
:
"sub-libp2p"
,
"External API <= Message({:?})"
,
source
);
let
event
=
GenericProtoOut
::
LegacyMessage
{
peer_id
:
source
,
message
:
From
::
from
(
&
received_handshake
[
..
]),
};
self
.events
.push_back
(
NetworkBehaviourAction
::
GenerateEvent
(
event
));
}
}
...
...
This diff is collapsed.
Click to expand it.
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