Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add node name to the log lines #7328

Merged
44 commits merged into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 22 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ members = [
"client/chain-spec",
"client/chain-spec/derive",
"client/cli",
"client/cli/proc-macro",
"client/consensus/aura",
"client/consensus/babe",
"client/consensus/babe/rpc",
Expand Down
1 change: 1 addition & 0 deletions bin/node-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {

if role.is_authority() {
let proposer = sc_basic_authorship::ProposerFactory::new(
task_manager.spawn_handle(),
client.clone(),
transaction_pool,
prometheus_registry.as_ref(),
Expand Down
3 changes: 2 additions & 1 deletion bin/node/bench/src/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ impl core::Benchmark for ConstructionBenchmark {
}

let mut proposer_factory = sc_basic_authorship::ProposerFactory::new(
context.spawn_handle.clone(),
context.client.clone(),
self.transactions.clone().into(),
None,
Expand Down Expand Up @@ -293,4 +294,4 @@ impl sp_transaction_pool::TransactionPool for Transactions {
fn ready_transaction(&self, _hash: &TxHash<Self>) -> Option<Arc<Self::InPoolTransaction>> {
unimplemented!()
}
}
}
2 changes: 2 additions & 0 deletions bin/node/cli/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ pub fn new_full_base(

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

let mut proposer_factory = sc_basic_authorship::ProposerFactory::new(
service.spawn_handle(),
service.client(),
service.transaction_pool(),
None,
Expand Down
21 changes: 15 additions & 6 deletions bin/node/testing/src/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,12 @@ impl BenchDb {
"Created seed db at {}",
dir.path().to_string_lossy(),
);
let (_client, _backend) = Self::bench_client(database_type, dir.path(), Profile::Native, &keyring);
let (_client, _backend, _task_executor) = Self::bench_client(
database_type,
dir.path(),
Profile::Native,
&keyring,
);
let directory_guard = Guard(dir);

BenchDb { keyring, directory_guard, database_type }
Expand Down Expand Up @@ -401,13 +406,14 @@ impl BenchDb {
dir: &std::path::Path,
profile: Profile,
keyring: &BenchKeyring,
) -> (Client, std::sync::Arc<Backend>) {
) -> (Client, std::sync::Arc<Backend>, TaskExecutor) {
let db_config = sc_client_db::DatabaseSettings {
state_cache_size: 16*1024*1024,
state_cache_child_ratio: Some((0, 100)),
pruning: PruningMode::ArchiveAll,
source: database_type.into_settings(dir.into()),
};
let task_executor = TaskExecutor::new();

let (client, backend) = sc_service::new_client(
db_config,
Expand All @@ -416,12 +422,12 @@ impl BenchDb {
None,
None,
ExecutionExtensions::new(profile.into_execution_strategies(), None),
Box::new(TaskExecutor::new()),
Box::new(task_executor.clone()),
None,
Default::default(),
).expect("Should not fail");

(client, backend)
(client, backend, task_executor)
}

/// Generate list of required inherents.
Expand Down Expand Up @@ -450,7 +456,7 @@ impl BenchDb {

/// Get cliet for this database operations.
pub fn client(&mut self) -> Client {
let (client, _backend) = Self::bench_client(
let (client, _backend, _task_executor) = Self::bench_client(
self.database_type,
self.directory_guard.path(),
Profile::Wasm,
Expand Down Expand Up @@ -504,7 +510,7 @@ impl BenchDb {
/// Clone this database and create context for testing/benchmarking.
pub fn create_context(&self, profile: Profile) -> BenchContext {
let BenchDb { directory_guard, keyring, database_type } = self.clone();
let (client, backend) = Self::bench_client(
let (client, backend, task_executor) = Self::bench_client(
database_type,
directory_guard.path(),
profile,
Expand All @@ -515,6 +521,7 @@ impl BenchDb {
client: Arc::new(client),
db_guard: directory_guard,
backend,
spawn_handle: Box::new(task_executor),
}
}
}
Expand Down Expand Up @@ -649,6 +656,8 @@ pub struct BenchContext {
pub client: Arc<Client>,
/// Node backend.
pub backend: Arc<Backend>,
/// Spawn handle.
pub spawn_handle: Box<dyn SpawnNamed>,

db_guard: Guard,
}
Expand Down
Loading