mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Integrate tracing (#6339)
Tracing Integration
- [reference](5bbf1859e9/projects/project-ideas.md (L297))
- [x] replace slog & log with tracing throughout the codebase
- [x] implement custom crit log
- [x] make relevant changes in the formatter
- [x] replace sloggers
- [x] re-write SSE logging components
cc: @macladson @eserilev
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#![cfg(any(feature = "mdbx", feature = "lmdb", feature = "redb"))]
|
||||
|
||||
use logging::test_logger;
|
||||
use maplit::hashset;
|
||||
use rayon::prelude::*;
|
||||
use slasher::{
|
||||
@@ -272,7 +271,7 @@ fn slasher_test(
|
||||
let tempdir = tempdir().unwrap();
|
||||
let config = Config::new(tempdir.path().into());
|
||||
let spec = chain_spec();
|
||||
let slasher = Slasher::open(config, spec, test_logger()).unwrap();
|
||||
let slasher = Slasher::open(config, spec).unwrap();
|
||||
let current_epoch = Epoch::new(current_epoch);
|
||||
|
||||
for (i, attestation) in attestations.iter().enumerate() {
|
||||
@@ -302,7 +301,7 @@ fn parallel_slasher_test(
|
||||
let tempdir = tempdir().unwrap();
|
||||
let config = Config::new(tempdir.path().into());
|
||||
let spec = chain_spec();
|
||||
let slasher = Slasher::open(config, spec, test_logger()).unwrap();
|
||||
let slasher = Slasher::open(config, spec).unwrap();
|
||||
let current_epoch = Epoch::new(current_epoch);
|
||||
|
||||
attestations
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![cfg(any(feature = "mdbx", feature = "lmdb", feature = "redb"))]
|
||||
|
||||
use logging::test_logger;
|
||||
use slasher::{
|
||||
test_utils::{block as test_block, chain_spec, E},
|
||||
Config, Slasher,
|
||||
@@ -13,7 +12,7 @@ fn empty_pruning() {
|
||||
let tempdir = tempdir().unwrap();
|
||||
let config = Config::new(tempdir.path().into());
|
||||
let spec = chain_spec();
|
||||
let slasher = Slasher::<E>::open(config, spec, test_logger()).unwrap();
|
||||
let slasher = Slasher::<E>::open(config, spec).unwrap();
|
||||
slasher.prune_database(Epoch::new(0)).unwrap();
|
||||
}
|
||||
|
||||
@@ -27,7 +26,7 @@ fn block_pruning() {
|
||||
config.history_length = 2;
|
||||
let spec = chain_spec();
|
||||
|
||||
let slasher = Slasher::<E>::open(config.clone(), spec, test_logger()).unwrap();
|
||||
let slasher = Slasher::<E>::open(config.clone(), spec).unwrap();
|
||||
let current_epoch = Epoch::from(2 * config.history_length);
|
||||
|
||||
// Pruning the empty database should be safe.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![cfg(any(feature = "mdbx", feature = "lmdb", feature = "redb"))]
|
||||
|
||||
use logging::test_logger;
|
||||
use rand::prelude::*;
|
||||
use slasher::{
|
||||
test_utils::{
|
||||
@@ -36,9 +35,8 @@ impl Default for TestConfig {
|
||||
fn make_db() -> (TempDir, SlasherDB<E>) {
|
||||
let tempdir = tempdir().unwrap();
|
||||
let initial_config = Arc::new(Config::new(tempdir.path().into()));
|
||||
let logger = test_logger();
|
||||
let spec = chain_spec();
|
||||
let db = SlasherDB::open(initial_config.clone(), spec, logger).unwrap();
|
||||
let db = SlasherDB::open(initial_config.clone(), spec).unwrap();
|
||||
(tempdir, db)
|
||||
}
|
||||
|
||||
@@ -60,7 +58,7 @@ fn random_test(seed: u64, mut db: SlasherDB<E>, test_config: TestConfig) -> Slas
|
||||
let config = Arc::new(config);
|
||||
db.update_config(config.clone());
|
||||
|
||||
let slasher = Slasher::<E>::from_config_and_db(config.clone(), db, test_logger()).unwrap();
|
||||
let slasher = Slasher::<E>::from_config_and_db(config.clone(), db).unwrap();
|
||||
|
||||
let validators = (0..num_validators as u64).collect::<Vec<u64>>();
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![cfg(any(feature = "mdbx", feature = "lmdb", feature = "redb"))]
|
||||
|
||||
use logging::test_logger;
|
||||
use slasher::{
|
||||
test_utils::{chain_spec, indexed_att},
|
||||
Config, Slasher,
|
||||
@@ -17,7 +16,7 @@ fn attestation_pruning_empty_wrap_around() {
|
||||
config.chunk_size = 16;
|
||||
config.history_length = 16;
|
||||
|
||||
let slasher = Slasher::open(config.clone(), spec, test_logger()).unwrap();
|
||||
let slasher = Slasher::open(config.clone(), spec).unwrap();
|
||||
|
||||
let v = vec![0];
|
||||
let history_length = config.history_length as u64;
|
||||
|
||||
Reference in New Issue
Block a user