Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
88c1f42
Initial commit
cecton Oct 7, 2020
95762f1
WIP
cecton Oct 9, 2020
685c122
WIP
cecton Oct 14, 2020
fea1d0c
WIP
cecton Oct 14, 2020
f0d5964
WIP
cecton Oct 15, 2020
a55ccf0
WIP
cecton Oct 15, 2020
ad7dbd5
CLEANUP
cecton Oct 15, 2020
c8e0841
Add notes to original source code
cecton Oct 15, 2020
dc2f401
CLEANUP
cecton Oct 15, 2020
34106dd
CLEANUP
cecton Oct 15, 2020
76f2d43
WIP
cecton Oct 15, 2020
0c278a8
WIP
cecton Oct 16, 2020
8257480
WIP
cecton Oct 16, 2020
47f7d3f
CLEANUP
cecton Oct 16, 2020
efb9b82
WIP
cecton Oct 16, 2020
346eaf1
Some doc
cecton Oct 16, 2020
9055ec2
Test with trybuild
cecton Oct 16, 2020
d46d87b
Revert "Test with trybuild" (issue with trybuild atm)
cecton Oct 16, 2020
2401a7c
Apply suggestions
cecton Oct 16, 2020
364b1b9
Merge commit ec1834646c3f81305dd01cc85d003d7be76daebf (no conflict)
cecton Oct 16, 2020
25970af
Rename derive to proc-macro
cecton Oct 16, 2020
8480619
Remove "prefix" feature from informant
cecton Oct 16, 2020
b14c3f8
Blocking task should use SpawnHandle::spawn_blocking
cecton Oct 16, 2020
499ade7
Improve doc as suggested
cecton Oct 16, 2020
aea5b53
Fixes
cecton Oct 16, 2020
0c83890
Apply suggestion
cecton Oct 16, 2020
2e6b613
Update client/cli/proc-macro/src/lib.rs
cecton Oct 21, 2020
3f61450
More suggestions
cecton Oct 21, 2020
a554480
CLEANUP
cecton Oct 21, 2020
58a7284
Improve error message
cecton Oct 21, 2020
de4678f
CLEANUP
cecton Oct 21, 2020
c101a09
Fix async issue
cecton Oct 21, 2020
35ae152
CLEANUP
cecton Oct 21, 2020
fb4c7bb
CLEANUP
cecton Oct 21, 2020
2238794
Add test
cecton Oct 21, 2020
c4e0039
fix doc test
cecton Oct 21, 2020
1a72fc5
Merge commit c2469ebdfbb9d051f892c7b896e835d78d60838d (no conflict)
cecton Oct 21, 2020
2752062
Update client/cli/src/logging.rs
cecton Oct 21, 2020
208bbe2
Update client/basic-authorship/src/basic_authorship.rs
cecton Oct 21, 2020
243dd6c
Update client/basic-authorship/src/basic_authorship.rs
cecton Oct 21, 2020
929bd1e
Apply suggestions
cecton Oct 21, 2020
f12a3f7
Suggestions
cecton Oct 21, 2020
b9d7723
Clarify doc
cecton Oct 21, 2020
f141b73
WIP
cecton Oct 21, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Suggestions
  • Loading branch information
cecton committed Oct 21, 2020
commit f12a3f766c5a446024656d165f5962b1fb49cc0d
2 changes: 1 addition & 1 deletion bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {

if role.is_authority() {
let proposer = sc_basic_authorship::ProposerFactory::new(
Box::new(task_manager.spawn_handle()),
task_manager.spawn_handle(),
client.clone(),
transaction_pool,
prometheus_registry.as_ref(),
Expand Down
4 changes: 2 additions & 2 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ pub fn new_full_base(

if let sc_service::config::Role::Authority { .. } = &role {
let proposer = sc_basic_authorship::ProposerFactory::new(
Box::new(task_manager.spawn_handle()),
task_manager.spawn_handle(),
client.clone(),
transaction_pool.clone(),
prometheus_registry.as_ref(),
Expand Down Expand Up @@ -558,7 +558,7 @@ mod tests {
);

let mut proposer_factory = sc_basic_authorship::ProposerFactory::new(
Box::new(service.spawn_handle()),
service.spawn_handle(),
service.client(),
service.transaction_pool(),
None,
Expand Down
8 changes: 4 additions & 4 deletions client/basic-authorship/src/basic_authorship.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ mod tests {
);

let mut proposer_factory = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
txpool.clone(),
None,
Expand Down Expand Up @@ -449,7 +449,7 @@ mod tests {
);

let mut proposer_factory = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
txpool.clone(),
None,
Expand Down Expand Up @@ -504,7 +504,7 @@ mod tests {
);

let mut proposer_factory = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
txpool.clone(),
None,
Expand Down Expand Up @@ -578,7 +578,7 @@ mod tests {
).unwrap();

let mut proposer_factory = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
txpool.clone(),
None,
Expand Down
5 changes: 4 additions & 1 deletion client/cli/proc-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ pub fn prefix_logs_with(arg: TokenStream, item: TokenStream) -> TokenStream {
(quote! {
#(#attrs)*
#vis #sig {
let span = #crate_name::tracing::info_span!("substrate-node", name = #name);
let span = #crate_name::tracing::info_span!(
#crate_name::PREFIX_LOG_SPAN,
name = #name,
);
let _enter = span.enter();

#block
Expand Down
2 changes: 2 additions & 0 deletions client/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ use tracing_subscriber::{
filter::Directive, fmt::time::ChronoLocal, layer::SubscriberExt, FmtSubscriber, Layer,
};

pub use logging::PREFIX_LOG_SPAN;

/// Substrate client CLI
///
/// This trait needs to be defined on the root structopt of the application. It will provide the
Expand Down
5 changes: 4 additions & 1 deletion client/cli/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ use tracing_subscriber::{
Layer,
};

/// Span name used for the logging prefix. See macro `sc_cli::prefix_logs_with!`
pub const PREFIX_LOG_SPAN: &str = "substrate-log-prefix";

pub(crate) struct EventFormat<T = SystemTime> {
pub(crate) timer: T,
pub(crate) ansi: bool,
Expand Down Expand Up @@ -111,7 +114,7 @@ where
.span(id)
.expect("new_span has been called for this span; qed");

if span.name() != "substrate-node" {
if span.name() != PREFIX_LOG_SPAN {
return;
}

Expand Down
6 changes: 3 additions & 3 deletions client/consensus/manual-seal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ mod tests {
Options::default(), api(), None, RevalidationType::Full, spawner.clone(),
));
let env = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
pool.clone(),
None,
Expand Down Expand Up @@ -369,7 +369,7 @@ mod tests {
Options::default(), api(), None, RevalidationType::Full, spawner.clone(),
));
let env = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
pool.clone(),
None,
Expand Down Expand Up @@ -445,7 +445,7 @@ mod tests {
Options::default(), pool_api.clone(), None, RevalidationType::Full, spawner.clone(),
));
let env = ProposerFactory::new(
Box::new(spawner.clone()),
spawner.clone(),
client.clone(),
pool.clone(),
None,
Expand Down