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
be1c0a24
Commit
be1c0a24
authored
6 years ago
by
Arkadiy Paronyan
Committed by
Gav Wood
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Gossip through all peers. (#359)
* Added some traces * Gossip for all * Fixed formatting
parent
14abd753
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
polkadot/network/src/lib.rs
+4
-0
4 additions, 0 deletions
polkadot/network/src/lib.rs
with
4 additions
and
0 deletions
polkadot/network/src/lib.rs
+
4
−
0
View file @
be1c0a24
...
...
@@ -183,6 +183,7 @@ impl CurrentConsensus {
}
/// Polkadot-specific messages.
#[derive(Debug)]
pub
enum
Message
{
/// signed statement and localized parent hash.
Statement
(
Hash
,
SignedStatement
),
...
...
@@ -250,6 +251,7 @@ impl Decode for Message {
}
fn
send_polkadot_message
(
ctx
:
&
mut
Context
<
Block
>
,
to
:
PeerId
,
message
:
Message
)
{
trace!
(
target
:
"p_net"
,
"Sending polkadot message to {}: {:?}"
,
to
,
message
);
let
encoded
=
message
.encode
();
ctx
.send_message
(
to
,
generic_message
::
Message
::
ChainSpecific
(
encoded
))
}
...
...
@@ -386,6 +388,7 @@ impl PolkadotProtocol {
}
fn
on_polkadot_message
(
&
mut
self
,
ctx
:
&
mut
Context
<
Block
>
,
peer_id
:
PeerId
,
raw
:
Vec
<
u8
>
,
msg
:
Message
)
{
trace!
(
target
:
"p_net"
,
"Polkadot message from {}: {:?}"
,
peer_id
,
msg
);
match
msg
{
Message
::
Statement
(
parent_hash
,
_statement
)
=>
self
.consensus_gossip
.on_chain_specific
(
ctx
,
peer_id
,
raw
,
parent_hash
),
...
...
@@ -535,6 +538,7 @@ impl Specialization<Block> for PolkadotProtocol {
fn
on_message
(
&
mut
self
,
ctx
:
&
mut
Context
<
Block
>
,
peer_id
:
PeerId
,
message
:
message
::
Message
<
Block
>
)
{
match
message
{
generic_message
::
Message
::
BftMessage
(
msg
)
=>
{
trace!
(
target
:
"p_net"
,
"Polkadot BFT message from {}: {:?}"
,
peer_id
,
msg
);
// TODO: check signature here? what if relevant block is unknown?
self
.consensus_gossip
.on_bft_message
(
ctx
,
peer_id
,
msg
)
}
...
...
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