Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
e1c2a2e6
Commit
e1c2a2e6
authored
Mar 04, 2021
by
Robert Klotzner
Browse files
Fix instrumentation log target for real.
parent
cee4f11b
Changes
15
Hide whitespace changes
Inline
Side-by-side
node/core/av-store/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -508,7 +508,7 @@ where
}
}
#[tracing::instrument(skip(subsystem,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(subsystem,
ctx),
target
=
LOG_TARGET)]
async
fn
run
<
Context
>
(
mut
subsystem
:
AvailabilityStoreSubsystem
,
mut
ctx
:
Context
)
where
Context
:
SubsystemContext
<
Message
=
AvailabilityStoreMessage
>
,
...
...
@@ -534,7 +534,7 @@ where
}
}
#[tracing::instrument(level
=
"trace"
,
skip(subsystem,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(subsystem,
ctx),
target
=
LOG_TARGET)]
async
fn
run_iteration
<
Context
>
(
ctx
:
&
mut
Context
,
subsystem
:
&
mut
AvailabilityStoreSubsystem
,
...
...
node/core/backing/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -865,7 +865,7 @@ impl CandidateBackingJob {
}
/// Import the statement and kick off validation work if it is a part of our assignment.
#[tracing::instrument(level
=
"trace"
,
skip(self,
parent_span),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self,
parent_span),
target
=
LOG_TARGET)]
async
fn
maybe_validate_and_import
(
&
mut
self
,
parent_span
:
&
jaeger
::
Span
,
...
...
@@ -884,7 +884,7 @@ impl CandidateBackingJob {
Ok
(())
}
#[tracing::instrument(level
=
"trace"
,
skip(self),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self),
target
=
LOG_TARGET)]
async
fn
sign_statement
(
&
self
,
statement
:
Statement
)
->
Option
<
SignedFullStatement
>
{
let
signed
=
self
.table_context
.validator
...
...
@@ -897,7 +897,7 @@ impl CandidateBackingJob {
Some
(
signed
)
}
#[tracing::instrument(level
=
"trace"
,
skip(self),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self),
target
=
LOG_TARGET)]
fn
check_statement_signature
(
&
self
,
statement
:
&
SignedFullStatement
)
->
Result
<
(),
Error
>
{
let
idx
=
statement
.validator_index
()
.0
as
usize
;
...
...
@@ -987,7 +987,7 @@ impl util::JobTrait for CandidateBackingJob {
const
NAME
:
&
'static
str
=
"CandidateBackingJob"
;
#[tracing::instrument(skip(span,
keystore,
metrics,
rx_to,
tx_from),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(span,
keystore,
metrics,
rx_to,
tx_from),
target
=
LOG_TARGET)]
fn
run
(
parent
:
Hash
,
span
:
Arc
<
jaeger
::
Span
>
,
...
...
node/network/approval-distribution/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -830,7 +830,7 @@ impl State {
/// Modify the reputation of a peer based on its behavior.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
modify_reputation
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
ApprovalDistributionMessage
>
,
peer_id
:
PeerId
,
...
...
@@ -854,7 +854,7 @@ impl ApprovalDistribution {
Self
{
metrics
}
}
#[tracing::instrument(skip(self,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(self,
ctx),
target
=
LOG_TARGET)]
async
fn
run
<
Context
>
(
self
,
ctx
:
Context
)
where
Context
:
SubsystemContext
<
Message
=
ApprovalDistributionMessage
>
,
...
...
@@ -864,7 +864,7 @@ impl ApprovalDistribution {
}
/// Used for testing.
#[tracing::instrument(skip(self,
ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(self,
ctx,
state),
target
=
LOG_TARGET)]
async
fn
run_inner
<
Context
>
(
self
,
mut
ctx
:
Context
,
state
:
&
mut
State
)
where
Context
:
SubsystemContext
<
Message
=
ApprovalDistributionMessage
>
,
...
...
node/network/availability-distribution/src/session_cache.rs
View file @
e1c2a2e6
...
...
@@ -116,7 +116,7 @@ impl SessionCache {
///
/// Use this function over any `fetch_session_info` if all you need is a reference to
/// `SessionInfo`, as it avoids an expensive clone.
#[tracing::instrument(level
=
"trace"
,
skip(self,
ctx,
with_info),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self,
ctx,
with_info),
target
=
LOG_TARGET)]
pub
async
fn
with_session_info
<
Context
,
F
,
R
>
(
&
mut
self
,
ctx
:
&
mut
Context
,
...
...
@@ -183,7 +183,7 @@ impl SessionCache {
///
/// We assume validators in a group are tried in reverse order, so the reported bad validators
/// will be put at the beginning of the group.
#[tracing::instrument(level
=
"trace"
,
skip(self,
report),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self,
report),
target
=
LOG_TARGET)]
pub
fn
report_bad
(
&
mut
self
,
report
:
BadValidators
)
->
Result
<
()
>
{
let
session
=
self
.session_info_cache
...
...
node/network/availability-recovery/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -589,7 +589,7 @@ async fn report_peer(
}
/// Machinery around launching interactions into the background.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
launch_interaction
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
AvailabilityRecoveryMessage
>
,
...
...
@@ -654,7 +654,7 @@ async fn launch_interaction(
}
/// Handles an availability recovery request.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_recover
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
AvailabilityRecoveryMessage
>
,
...
...
@@ -718,7 +718,7 @@ async fn handle_recover(
}
/// Queries a chunk from av-store.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
query_chunk
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
AvailabilityRecoveryMessage
>
,
candidate_hash
:
CandidateHash
,
...
...
@@ -733,7 +733,7 @@ async fn query_chunk(
}
/// Queries a chunk from av-store.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
query_full_data
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
AvailabilityRecoveryMessage
>
,
candidate_hash
:
CandidateHash
,
...
...
@@ -747,7 +747,7 @@ async fn query_full_data(
}
/// Handles message from interaction.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_from_interaction
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
AvailabilityRecoveryMessage
>
,
...
...
@@ -827,7 +827,7 @@ async fn handle_from_interaction(
}
/// Handles a network bridge update.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_network_update
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
AvailabilityRecoveryMessage
>
,
...
...
node/network/bridge/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -142,7 +142,7 @@ struct PeerData {
}
/// Main driver, processing network events and messages from other subsystems.
#[tracing::instrument(skip(bridge,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(bridge,
ctx),
target
=
LOG_TARGET)]
async
fn
run_network
<
N
,
AD
>
(
mut
bridge
:
NetworkBridge
<
N
,
AD
>
,
mut
ctx
:
impl
SubsystemContext
<
Message
=
NetworkBridgeMessage
>
,
...
...
@@ -417,7 +417,7 @@ fn construct_view(live_heads: impl DoubleEndedIterator<Item = Hash>, finalized_n
)
}
#[tracing::instrument(level
=
"trace"
,
skip(net,
ctx,
validation_peers,
collation_peers),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(net,
ctx,
validation_peers,
collation_peers),
target
=
LOG_TARGET)]
async
fn
update_our_view
(
net
:
&
mut
impl
Network
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
NetworkBridgeMessage
>
,
...
...
@@ -460,7 +460,7 @@ async fn update_our_view(
// Handle messages on a specific peer-set. The peer is expected to be connected on that
// peer-set.
#[tracing::instrument(level
=
"trace"
,
skip(peers,
messages,
net),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(peers,
messages,
net),
target
=
LOG_TARGET)]
async
fn
handle_peer_messages
<
M
>
(
peer
:
PeerId
,
peers
:
&
mut
HashMap
<
PeerId
,
PeerData
>
,
...
...
@@ -516,7 +516,7 @@ async fn handle_peer_messages<M>(
Ok
(
outgoing_messages
)
}
#[tracing::instrument(level
=
"trace"
,
skip(net,
peers),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(net,
peers),
target
=
LOG_TARGET)]
async
fn
send_validation_message
<
I
>
(
net
:
&
mut
impl
Network
,
peers
:
I
,
...
...
@@ -529,7 +529,7 @@ async fn send_validation_message<I>(
send_message
(
net
,
peers
,
PeerSet
::
Validation
,
message
)
.await
}
#[tracing::instrument(level
=
"trace"
,
skip(net,
peers),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(net,
peers),
target
=
LOG_TARGET)]
async
fn
send_collation_message
<
I
>
(
net
:
&
mut
impl
Network
,
peers
:
I
,
...
...
@@ -557,7 +557,7 @@ async fn dispatch_collation_event_to_all(
dispatch_collation_events_to_all
(
std
::
iter
::
once
(
event
),
ctx
)
.await
}
#[tracing::instrument(level
=
"trace"
,
skip(events,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(events,
ctx),
target
=
LOG_TARGET)]
async
fn
dispatch_validation_events_to_all
<
I
>
(
events
:
I
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
NetworkBridgeMessage
>
,
...
...
@@ -569,7 +569,7 @@ async fn dispatch_validation_events_to_all<I>(
ctx
.send_messages
(
events
.into_iter
()
.flat_map
(
AllMessages
::
dispatch_iter
))
.await
}
#[tracing::instrument(level
=
"trace"
,
skip(events,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(events,
ctx),
target
=
LOG_TARGET)]
async
fn
dispatch_collation_events_to_all
<
I
>
(
events
:
I
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
NetworkBridgeMessage
>
,
...
...
node/network/bridge/src/network.rs
View file @
e1c2a2e6
...
...
@@ -151,7 +151,7 @@ impl Network for Arc<NetworkService<Block, Hash>> {
NetworkService
::
event_stream
(
self
,
"polkadot-network-bridge"
)
.boxed
()
}
#[tracing::instrument(level
=
"trace"
,
skip(self),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self),
target
=
LOG_TARGET)]
fn
action_sink
<
'a
>
(
&
'a
mut
self
,
)
->
Pin
<
Box
<
dyn
Sink
<
NetworkAction
,
Error
=
SubsystemError
>
+
Send
+
'a
>>
{
...
...
node/network/bridge/src/validator_discovery.rs
View file @
e1c2a2e6
...
...
@@ -169,7 +169,7 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
/// Find connected validators using the given `validator_ids`.
///
/// Returns a [`HashMap`] that contains the found [`AuthorityDiscoveryId`]'s and their associated [`PeerId`]'s.
#[tracing::instrument(level
=
"trace"
,
skip(self,
authority_discovery_service),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self,
authority_discovery_service),
target
=
LOG_TARGET)]
async
fn
find_connected_validators
(
&
mut
self
,
validator_ids
:
&
[
AuthorityDiscoveryId
],
...
...
@@ -216,7 +216,7 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
/// This method will also clean up all previously revoked requests.
/// it takes `network_service` and `authority_discovery_service` by value
/// and returns them as a workaround for the Future: Send requirement imposed by async fn impl.
#[tracing::instrument(level
=
"trace"
,
skip(self,
connected,
network_service,
authority_discovery_service),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self,
connected,
network_service,
authority_discovery_service),
target
=
LOG_TARGET)]
pub
async
fn
on_request
(
&
mut
self
,
validator_ids
:
Vec
<
AuthorityDiscoveryId
>
,
...
...
@@ -335,7 +335,7 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
}
/// Should be called when a peer connected.
#[tracing::instrument(level
=
"trace"
,
skip(self,
authority_discovery_service),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(self,
authority_discovery_service),
target
=
LOG_TARGET)]
pub
async
fn
on_peer_connected
(
&
mut
self
,
peer_id
:
PeerId
,
...
...
node/network/collator-protocol/src/collator_side.rs
View file @
e1c2a2e6
...
...
@@ -260,7 +260,7 @@ impl State {
/// or the relay-parent isn't in the active-leaves set, we ignore the message
/// as it must be invalid in that case - although this indicates a logic error
/// elsewhere in the node.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
target
=
LOG_TARGET)]
async
fn
distribute_collation
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -338,7 +338,7 @@ async fn distribute_collation(
/// Get the Id of the Core that is assigned to the para being collated on if any
/// and the total number of cores.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
determine_core
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
para_id
:
ParaId
,
...
...
@@ -360,7 +360,7 @@ async fn determine_core(
/// Figure out current and next group of validators assigned to the para being collated on.
///
/// Returns [`ValidatorId`]'s of current and next group as determined based on the `relay_parent`.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
determine_our_validators
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
core_index
:
CoreIndex
,
...
...
@@ -386,7 +386,7 @@ async fn determine_our_validators(
}
/// Issue a `Declare` collation message to the given `peer`.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
declare
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -404,7 +404,7 @@ async fn declare(
/// Issue a connection request to a set of validators and
/// revoke the previous connection request.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
connect_to_validators
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
relay_parent
:
Hash
,
...
...
@@ -428,7 +428,7 @@ async fn connect_to_validators(
///
/// This will only advertise a collation if there exists one for the given `relay_parent` and the given `peer` is
/// set as validator for our para at the given `relay_parent`.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
advertise_collation
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -484,7 +484,7 @@ async fn advertise_collation(
}
/// The main incoming message dispatching switch.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
process_msg
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -568,7 +568,7 @@ async fn process_msg(
}
/// Issue a response to a previously requested collation.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
target
=
LOG_TARGET)]
async
fn
send_collation
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -602,7 +602,7 @@ async fn send_collation(
}
/// A networking messages switch.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_incoming_peer_message
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -685,7 +685,7 @@ async fn handle_incoming_peer_message(
}
/// Our view has changed.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_peer_view_change
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -706,7 +706,7 @@ async fn handle_peer_view_change(
/// A validator is connected.
///
/// `Declare` that we are a collator with a given `CollatorId`.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_validator_connected
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -735,7 +735,7 @@ async fn handle_validator_connected(
}
/// Bridge messages switch.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_network_msg
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -767,7 +767,7 @@ async fn handle_network_msg(
}
/// Handles our view changes.
#[tracing::instrument(level
=
"trace"
,
skip(state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(state),
target
=
LOG_TARGET)]
async
fn
handle_our_view_change
(
state
:
&
mut
State
,
view
:
OurView
,
...
...
@@ -810,7 +810,7 @@ async fn handle_our_view_change(
}
/// The collator protocol collator side main loop.
#[tracing::instrument(skip(ctx,
metrics),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(ctx,
metrics),
target
=
LOG_TARGET)]
pub
(
crate
)
async
fn
run
(
mut
ctx
:
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
our_id
:
CollatorId
,
...
...
node/network/collator-protocol/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -86,7 +86,7 @@ impl CollatorProtocolSubsystem {
}
}
#[tracing::instrument(skip(self,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(self,
ctx),
target
=
LOG_TARGET)]
async
fn
run
<
Context
>
(
self
,
ctx
:
Context
)
->
Result
<
()
>
where
Context
:
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
...
...
@@ -126,7 +126,7 @@ where
}
/// Modify the reputation of a peer based on its behavior.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
modify_reputation
<
Context
>
(
ctx
:
&
mut
Context
,
peer
:
PeerId
,
rep
:
Rep
)
where
Context
:
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
...
...
node/network/collator-protocol/src/validator_side.rs
View file @
e1c2a2e6
...
...
@@ -214,7 +214,7 @@ struct State {
}
/// Another subsystem has requested to fetch collations on a particular leaf for some para.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
tx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
tx),
target
=
LOG_TARGET)]
async
fn
fetch_collation
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -242,7 +242,7 @@ where
}
/// Report a collator for some malicious actions.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
report_collator
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -260,7 +260,7 @@ where
}
/// Some other subsystem has reported a collator as a good one, bump reputation.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
note_good_collation
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -275,7 +275,7 @@ where
}
/// Notify a collator that its collation got seconded.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
notify_collation_seconded
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
CollatorProtocolMessage
>
,
state
:
&
mut
State
,
...
...
@@ -310,7 +310,7 @@ async fn notify_collation_seconded(
/// A peer's view has changed. A number of things should be done:
/// - Ongoing collation requests have to be cancelled.
/// - Advertisements by this peer that are no longer relevant have to be removed.
#[tracing::instrument(level
=
"trace"
,
skip(state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(state),
target
=
LOG_TARGET)]
async
fn
handle_peer_view_change
(
state
:
&
mut
State
,
peer_id
:
PeerId
,
...
...
@@ -352,7 +352,7 @@ async fn handle_peer_view_change(
/// - Cancel all ongoing requests
/// - Reply to interested parties if any
/// - Store collation.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
target
=
LOG_TARGET)]
async
fn
received_collation
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -418,7 +418,7 @@ where
/// - Check if the requested collation is in our view.
/// - Update PerRequest records with the `result` field if necessary.
/// And as such invocations of this function may rely on that.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
result),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
result),
target
=
LOG_TARGET)]
async
fn
request_collation
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -498,7 +498,7 @@ where
}
/// Notify `CandidateSelectionSubsystem` that a collation has been advertised.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
notify_candidate_selection
<
Context
>
(
ctx
:
&
mut
Context
,
collator
:
CollatorId
,
...
...
@@ -518,7 +518,7 @@ where
}
/// Networking message has been received.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
process_incoming_peer_message
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -567,7 +567,7 @@ where
/// A leaf has become inactive so we want to
/// - Cancel all ongoing collation requests that are on top of that leaf.
/// - Remove all stored collations relevant to that leaf.
#[tracing::instrument(level
=
"trace"
,
skip(state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(state),
target
=
LOG_TARGET)]
async
fn
remove_relay_parent
(
state
:
&
mut
State
,
relay_parent
:
Hash
,
...
...
@@ -591,7 +591,7 @@ async fn remove_relay_parent(
}
/// Our view has changed.
#[tracing::instrument(level
=
"trace"
,
skip(state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(state),
target
=
LOG_TARGET)]
async
fn
handle_our_view_change
(
state
:
&
mut
State
,
view
:
OurView
,
...
...
@@ -626,7 +626,7 @@ async fn handle_our_view_change(
}
/// A request has timed out.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
request_timed_out
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -650,7 +650,7 @@ where
}
/// Bridge event switch.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_network_msg
<
Context
>
(
ctx
:
&
mut
Context
,
state
:
&
mut
State
,
...
...
@@ -685,7 +685,7 @@ where
}
/// The main message receiver switch.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
process_msg
<
Context
>
(
ctx
:
&
mut
Context
,
msg
:
CollatorProtocolMessage
,
...
...
@@ -742,7 +742,7 @@ where
}
/// The main run loop.
#[tracing::instrument(skip(ctx,
metrics),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(ctx,
metrics),
target
=
LOG_TARGET)]
pub
(
crate
)
async
fn
run
<
Context
>
(
mut
ctx
:
Context
,
request_timeout
:
Duration
,
...
...
node/network/gossip-support/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -54,7 +54,7 @@ impl GossipSupport {
Self
{}
}
#[tracing::instrument(skip(self,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(skip(self,
ctx),
target
=
LOG_TARGET)]
async
fn
run
<
Context
>
(
self
,
mut
ctx
:
Context
)
where
Context
:
SubsystemContext
<
Message
=
GossipSupportMessage
>
,
...
...
node/network/pov-distribution/src/lib.rs
View file @
e1c2a2e6
...
...
@@ -144,7 +144,7 @@ fn send_pov_message(
/// Handles the signal. If successful, returns `true` if the subsystem should conclude,
/// `false` otherwise.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_signal
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -211,7 +211,7 @@ async fn handle_signal(
/// Notify peers that we are awaiting a given PoV hash.
///
/// This only notifies peers who have the relay parent in their view.
#[tracing::instrument(level
=
"trace"
,
skip(peers,
ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(peers,
ctx),
target
=
LOG_TARGET)]
async
fn
notify_all_we_are_awaiting
(
peers
:
&
mut
HashMap
<
PeerId
,
PeerState
>
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -240,7 +240,7 @@ async fn notify_all_we_are_awaiting(
}
/// Notify one peer about everything we're awaiting at a given relay-parent.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
relay_parent_state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
relay_parent_state),
target
=
LOG_TARGET)]
async
fn
notify_one_we_are_awaiting_many
(
peer
:
&
PeerId
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -267,7 +267,7 @@ async fn notify_one_we_are_awaiting_many(
}
/// Distribute a PoV to peers who are awaiting it.
#[tracing::instrument(level
=
"trace"
,
skip(peers,
ctx,
metrics,
pov),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(peers,
ctx,
metrics,
pov),
target
=
LOG_TARGET)]
async
fn
distribute_to_awaiting
(
peers
:
&
mut
HashMap
<
PeerId
,
PeerState
>
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -408,7 +408,7 @@ async fn determine_relevant_validators(
}
/// Handles a `FetchPoV` message.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
response_sender),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
response_sender),
target
=
LOG_TARGET)]
async
fn
handle_fetch
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -460,7 +460,7 @@ async fn handle_fetch(
}
/// Handles a `DistributePoV` message.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
pov),
target
=
LOG_TARGET)]
async
fn
handle_distribute
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -512,7 +512,7 @@ async fn handle_distribute(
}
/// Report a reputation change for a peer.
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx),
target
=
LOG_TARGET)]
async
fn
report_peer
(
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
peer
:
PeerId
,
...
...
@@ -522,7 +522,7 @@ async fn report_peer(
}
/// Handle a notification from a peer that they are awaiting some PoVs.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state),
target
=
LOG_TARGET)]
async
fn
handle_awaiting
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -576,7 +576,7 @@ async fn handle_awaiting(
/// Handle an incoming PoV from our peer. Reports them if unexpected, rewards them if not.
///
/// Completes any requests awaiting that PoV.
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
encoded_pov),
fields(
target
=
LOG_TARGET)
)
]
#[tracing::instrument(level
=
"trace"
,
skip(ctx,
state,
encoded_pov),
target
=
LOG_TARGET)]
async
fn
handle_incoming_pov
(
state
:
&
mut
State
,
ctx
:
&
mut
impl
SubsystemContext
<
Message
=
PoVDistributionMessage
>
,
...
...
@@ -663,7 +663,7 @@ fn handle_validator_connected(state: &mut State, peer_id: PeerId) {
}