From 56b2d4b5253bf352e5b76d222209485e262712c1 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Tue, 24 Jun 2025 09:29:10 +0300 Subject: [PATCH] Remove instrumenting log level (#7636) https://github.com/sigp/lighthouse/issues/7155 Theres some additional places we set instrumenting log levels that wasn't covered in #7620 --- .../beacon_chain/src/validator_monitor.rs | 45 ------------------- beacon_node/network/src/subnet_service/mod.rs | 9 ---- .../network/src/sync/backfill_sync/mod.rs | 21 --------- .../network/src/sync/block_lookups/mod.rs | 24 +--------- beacon_node/network/src/sync/peer_sampling.rs | 7 +-- .../network/src/sync/range_sync/chain.rs | 42 ++++++++--------- .../network/src/sync/range_sync/range.rs | 9 ---- common/task_executor/src/lib.rs | 20 ++++----- 8 files changed, 33 insertions(+), 144 deletions(-) diff --git a/beacon_node/beacon_chain/src/validator_monitor.rs b/beacon_node/beacon_chain/src/validator_monitor.rs index c4846b1a89..e2befe340f 100644 --- a/beacon_node/beacon_chain/src/validator_monitor.rs +++ b/beacon_node/beacon_chain/src/validator_monitor.rs @@ -439,7 +439,6 @@ impl ValidatorMonitor { /// emit metrics and logs on a per-validator basis (rather than just an /// aggregated basis). #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -450,7 +449,6 @@ impl ValidatorMonitor { /// Add some validators to `self` for additional monitoring. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -473,7 +471,6 @@ impl ValidatorMonitor { /// Add an unaggregated attestation #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -492,7 +489,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -504,7 +500,6 @@ impl ValidatorMonitor { /// Reads information from the given `state`. The `state` *must* be valid (i.e, able to be /// imported). #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -622,7 +617,6 @@ impl ValidatorMonitor { /// Add missed non-finalized blocks for the monitored validators #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -724,7 +718,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -743,7 +736,6 @@ impl ValidatorMonitor { /// Process the unaggregated attestations generated by the service `attestation_simulator_service` /// and check if the attestation qualifies for a reward matching the flags source/target/head #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -821,7 +813,6 @@ impl ValidatorMonitor { /// We allow disabling tracking metrics on an individual validator basis /// since it can result in untenable cardinality with high validator counts. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -835,7 +826,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1118,7 +1108,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1131,7 +1120,6 @@ impl ValidatorMonitor { /// Returns the number of validators monitored by `self`. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1142,7 +1130,6 @@ impl ValidatorMonitor { /// Return the `id`'s of all monitored validators. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1152,7 +1139,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1166,7 +1152,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1179,7 +1164,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1191,7 +1175,6 @@ impl ValidatorMonitor { /// If `self.auto_register == true`, add the `validator_index` to `self.monitored_validators`. /// Otherwise, do nothing. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1219,7 +1202,6 @@ impl ValidatorMonitor { /// Process a block received on gossip. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1236,7 +1218,6 @@ impl ValidatorMonitor { /// Process a block received on the HTTP API from a local validator. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1252,7 +1233,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1297,7 +1277,6 @@ impl ValidatorMonitor { /// Register an attestation seen on the gossip network. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1318,7 +1297,6 @@ impl ValidatorMonitor { /// Register an attestation seen on the HTTP API. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1338,7 +1316,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1430,7 +1407,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1554,7 +1530,6 @@ impl ValidatorMonitor { /// /// Note: Blocks that get orphaned will skew the inclusion distance calculation. #[instrument(parent = None, - level = "info", name = "validator_monitor", skip_all )] @@ -1634,7 +1609,6 @@ impl ValidatorMonitor { /// Register a sync committee message received over gossip. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1655,7 +1629,6 @@ impl ValidatorMonitor { /// Register a sync committee message received over the http api. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1676,7 +1649,6 @@ impl ValidatorMonitor { /// Register a sync committee message. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1731,7 +1703,6 @@ impl ValidatorMonitor { /// Register a sync committee contribution received over gossip. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1754,7 +1725,6 @@ impl ValidatorMonitor { /// Register a sync committee contribution received over the http api. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1777,7 +1747,6 @@ impl ValidatorMonitor { /// Register a sync committee contribution. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1865,7 +1834,6 @@ impl ValidatorMonitor { /// Register that the `sync_aggregate` was included in a *valid* `BeaconBlock`. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1908,7 +1876,6 @@ impl ValidatorMonitor { /// Register an exit from the gossip network. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1919,7 +1886,6 @@ impl ValidatorMonitor { /// Register an exit from the HTTP API. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1930,7 +1896,6 @@ impl ValidatorMonitor { /// Register an exit included in a *valid* beacon block. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1940,7 +1905,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1969,7 +1933,6 @@ impl ValidatorMonitor { /// Register a proposer slashing from the gossip network. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1980,7 +1943,6 @@ impl ValidatorMonitor { /// Register a proposer slashing from the HTTP API. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -1991,7 +1953,6 @@ impl ValidatorMonitor { /// Register a proposer slashing included in a *valid* `BeaconBlock`. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -2001,7 +1962,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -2040,7 +2000,6 @@ impl ValidatorMonitor { /// Register an attester slashing from the gossip network. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -2051,7 +2010,6 @@ impl ValidatorMonitor { /// Register an attester slashing from the HTTP API. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -2062,7 +2020,6 @@ impl ValidatorMonitor { /// Register an attester slashing included in a *valid* `BeaconBlock`. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -2072,7 +2029,6 @@ impl ValidatorMonitor { } #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all @@ -2119,7 +2075,6 @@ impl ValidatorMonitor { /// /// Should be called whenever Prometheus is scraping Lighthouse. #[instrument(parent = None, - level = "info", fields(service = "validator_monitor"), name = "validator_monitor", skip_all diff --git a/beacon_node/network/src/subnet_service/mod.rs b/beacon_node/network/src/subnet_service/mod.rs index fb177a11e7..b47b1ab99f 100644 --- a/beacon_node/network/src/subnet_service/mod.rs +++ b/beacon_node/network/src/subnet_service/mod.rs @@ -228,7 +228,6 @@ impl SubnetService { /// This returns a result simply for the ergonomics of using ?. The result can be /// safely dropped. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -368,7 +367,6 @@ impl SubnetService { /// Checks if we have subscribed aggregate validators for the subnet. If not, checks the gossip /// verification, re-propagates and returns false. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -398,7 +396,6 @@ impl SubnetService { /// Adds an event to the event queue and notifies that this service is ready to be polled /// again. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -415,7 +412,6 @@ impl SubnetService { /// If there is sufficient time, queues a peer discovery request for all the required subnets. // NOTE: Sending early subscriptions results in early searching for peers on subnets. #[instrument(parent = None, - level = "info", name = "subnet_service", skip_all )] @@ -467,7 +463,6 @@ impl SubnetService { // Subscribes to the subnet if it should be done immediately, or schedules it if required. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -525,7 +520,6 @@ impl SubnetService { /// Adds a subscription event to the sync subnet. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -580,7 +574,6 @@ impl SubnetService { /// already subscribed, extends the timeout if necessary. If this is a new subscription, we send /// out the appropriate events. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -641,7 +634,6 @@ impl SubnetService { // Unsubscribes from a subnet that was removed. #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all @@ -664,7 +656,6 @@ impl Stream for SubnetService { type Item = SubnetServiceMessage; #[instrument(parent = None, - level = "info", fields(service = "subnet_service"), name = "subnet_service", skip_all diff --git a/beacon_node/network/src/sync/backfill_sync/mod.rs b/beacon_node/network/src/sync/backfill_sync/mod.rs index 035349c475..ba66e41aca 100644 --- a/beacon_node/network/src/sync/backfill_sync/mod.rs +++ b/beacon_node/network/src/sync/backfill_sync/mod.rs @@ -192,7 +192,6 @@ impl BackFillSync { /// Pauses the backfill sync if it's currently syncing. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -209,7 +208,6 @@ impl BackFillSync { /// If resuming is successful, reports back the current syncing metrics. #[must_use = "A failure here indicates the backfill sync has failed and the global sync state should be updated"] #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -290,7 +288,6 @@ impl BackFillSync { /// If we are in a failed state, update a local variable to indicate we are able to restart /// the failed sync on the next attempt. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -304,7 +301,6 @@ impl BackFillSync { /// A peer has disconnected. /// If the peer has active batches, those are considered failed and re-requested. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -324,7 +320,6 @@ impl BackFillSync { /// /// If the batch exists it is re-requested. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -367,7 +362,6 @@ impl BackFillSync { /// join the system. /// The sync manager should update the global sync state on failure. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -424,7 +418,6 @@ impl BackFillSync { /// /// This resets past variables, to allow for a fresh start when resuming. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -461,7 +454,6 @@ impl BackFillSync { /// Processes the batch with the given id. /// The batch must exist and be ready for processing #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -525,7 +517,6 @@ impl BackFillSync { /// of the batch processor. /// If an error is returned the BackFill sync has failed. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -683,7 +674,6 @@ impl BackFillSync { /// Processes the next ready batch. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -752,7 +742,6 @@ impl BackFillSync { /// If a previous batch has been validated and it had been re-processed, penalize the original /// peer. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -849,7 +838,6 @@ impl BackFillSync { /// have received are incorrect or invalid. This indicates the peer has not performed as /// intended and can result in downvoting a peer. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -906,7 +894,6 @@ impl BackFillSync { /// Requests the batch assigned to the given id from a given peer. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -983,7 +970,6 @@ impl BackFillSync { /// When resuming a chain, this function searches for batches that need to be re-downloaded and /// transitions their state to redownload the batch. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1013,7 +999,6 @@ impl BackFillSync { /// Attempts to request the next required batches from the peer pool if the chain is syncing. It will exhaust the peer /// pool and left over batches until the batch buffer is reached or all peers are exhausted. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1043,7 +1028,6 @@ impl BackFillSync { /// Creates the next required batch from the chain. If there are no more batches required, /// `false` is returned. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1110,7 +1094,6 @@ impl BackFillSync { /// This errors if the beacon chain indicates that backfill sync has already completed or is /// not required. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1129,7 +1112,6 @@ impl BackFillSync { /// Checks with the beacon chain if backfill sync has completed. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1150,7 +1132,6 @@ impl BackFillSync { /// Checks if backfill would complete by syncing to `start_epoch`. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1165,7 +1146,6 @@ impl BackFillSync { /// Updates the global network state indicating the current state of a backfill sync. #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all @@ -1175,7 +1155,6 @@ impl BackFillSync { } #[instrument(parent = None, - level = "info", fields(service = "backfill_sync"), name = "backfill_sync", skip_all diff --git a/beacon_node/network/src/sync/block_lookups/mod.rs b/beacon_node/network/src/sync/block_lookups/mod.rs index a7f2e0d434..c8bd8c170f 100644 --- a/beacon_node/network/src/sync/block_lookups/mod.rs +++ b/beacon_node/network/src/sync/block_lookups/mod.rs @@ -127,7 +127,7 @@ use lighthouse_network::service::api_types::Id; pub(crate) type BlockLookupSummary = (Id, Hash256, Option, Vec); impl BlockLookups { - #[instrument(parent = None,level = "info", fields(service = "lookup_sync"), name = "lookup_sync")] + #[instrument(parent = None, fields(service = "lookup_sync"), name = "lookup_sync")] pub fn new() -> Self { Self { failed_chains: LRUTimeCache::new(Duration::from_secs( @@ -149,7 +149,6 @@ impl BlockLookups { #[cfg(test)] #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -160,7 +159,6 @@ impl BlockLookups { #[cfg(test)] #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -174,7 +172,6 @@ impl BlockLookups { /// Returns a vec of all parent lookup chains by tip, in descending slot order (tip first) #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -196,7 +193,6 @@ impl BlockLookups { /// /// Returns true if the lookup is created or already exists #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -235,7 +231,6 @@ impl BlockLookups { /// /// Returns true if the lookup is created or already exists #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -257,7 +252,6 @@ impl BlockLookups { /// /// Returns true if the lookup is created or already exists #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -365,7 +359,6 @@ impl BlockLookups { /// constructed. /// Returns true if the lookup is created or already exists #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -474,7 +467,6 @@ impl BlockLookups { /// Process a block or blob response received from a single lookup request. #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -565,7 +557,6 @@ impl BlockLookups { /* Error responses */ #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -579,7 +570,6 @@ impl BlockLookups { /* Processing responses */ #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -605,7 +595,6 @@ impl BlockLookups { } #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -800,7 +789,6 @@ impl BlockLookups { } #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -831,7 +819,6 @@ impl BlockLookups { /// Makes progress on the immediate children of `block_root` #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -862,7 +849,6 @@ impl BlockLookups { /// the parent to make progress to resolve, therefore we must drop them if the parent is /// dropped. #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -892,7 +878,6 @@ impl BlockLookups { /// Common handler a lookup request error, drop it and update metrics /// Returns true if the lookup is created or already exists #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -935,7 +920,6 @@ impl BlockLookups { /// Drops all the single block requests and returns how many requests were dropped. #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -947,7 +931,6 @@ impl BlockLookups { } #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -961,7 +944,6 @@ impl BlockLookups { /// Perform some prune operations on lookups on some interval #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -990,7 +972,6 @@ impl BlockLookups { /// Instead there's no negative for keeping lookups with no peers around for some time. If we /// regularly prune them, it should not be a memory concern (TODO: maybe yes!). #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -1033,7 +1014,6 @@ impl BlockLookups { /// - One single clear warn level log per stuck incident /// - If the original bug is sporadic, it reduces the time a node is stuck from forever to 15 min #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -1076,7 +1056,6 @@ impl BlockLookups { /// Recursively find the oldest ancestor lookup of another lookup #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all @@ -1106,7 +1085,6 @@ impl BlockLookups { /// Note: Takes a `lookup_id` as argument to allow recursion on mutable lookups, without having /// to duplicate the code to add peers to a lookup #[instrument(parent = None, - level = "info", fields(service = "lookup_sync"), name = "lookup_sync", skip_all diff --git a/beacon_node/network/src/sync/peer_sampling.rs b/beacon_node/network/src/sync/peer_sampling.rs index 2e011cd7f9..4ad77176aa 100644 --- a/beacon_node/network/src/sync/peer_sampling.rs +++ b/beacon_node/network/src/sync/peer_sampling.rs @@ -29,7 +29,7 @@ pub struct Sampling { } impl Sampling { - #[instrument(parent = None,level = "info", fields(service = "sampling"), name = "sampling")] + #[instrument(parent = None, fields(service = "sampling"), name = "sampling")] pub fn new(sampling_config: SamplingConfig) -> Self { Self { requests: <_>::default(), @@ -49,7 +49,6 @@ impl Sampling { #[cfg(test)] #[instrument(parent = None, - level = "info", fields(service = "sampling"), name = "sampling", skip_all @@ -72,7 +71,6 @@ impl Sampling { /// - `Some`: Request completed, won't make more progress. Expect requester to act on the result. /// - `None`: Request still active, requester should do no action #[instrument(parent = None, - level = "info", fields(service = "sampling"), name = "sampling", skip_all @@ -123,7 +121,6 @@ impl Sampling { /// - `Some`: Request completed, won't make more progress. Expect requester to act on the result. /// - `None`: Request still active, requester should do no action #[instrument(parent = None, - level = "info", fields(service = "sampling"), name = "sampling", skip_all @@ -153,7 +150,6 @@ impl Sampling { /// - `Some`: Request completed, won't make more progress. Expect requester to act on the result. /// - `None`: Request still active, requester should do no action #[instrument(parent = None, - level = "info", fields(service = "sampling"), name = "sampling", skip_all @@ -178,7 +174,6 @@ impl Sampling { /// conveniently), to an Option first format to use an `if let Some() { act on result }` pattern /// in the sync manager. #[instrument(parent = None, - level = "info", fields(service = "sampling"), name = "sampling", skip_all diff --git a/beacon_node/network/src/sync/range_sync/chain.rs b/beacon_node/network/src/sync/range_sync/chain.rs index 4e924d2d35..cc49c43711 100644 --- a/beacon_node/network/src/sync/range_sync/chain.rs +++ b/beacon_node/network/src/sync/range_sync/chain.rs @@ -159,19 +159,19 @@ impl SyncingChain { } /// Get the chain's id. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn id(&self) -> ChainId { self.id } /// Peers currently syncing this chain. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn peers(&self) -> impl Iterator + '_ { self.peers.iter().cloned() } /// Progress in epochs made by the chain - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn processed_epochs(&self) -> u64 { self.processing_target .saturating_sub(self.start_epoch) @@ -179,7 +179,7 @@ impl SyncingChain { } /// Returns the total count of pending blocks in all the batches of this chain - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn pending_blocks(&self) -> usize { self.batches .values() @@ -189,7 +189,7 @@ impl SyncingChain { /// Removes a peer from the chain. /// If the peer has active batches, those are considered failed and re-requested. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn remove_peer(&mut self, peer_id: &PeerId) -> ProcessingResult { self.peers.remove(peer_id); @@ -201,7 +201,7 @@ impl SyncingChain { } /// Returns the latest slot number that has been processed. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn current_processed_slot(&self) -> Slot { // the last slot we processed was included in the previous batch, and corresponds to the // first slot of the current target epoch @@ -258,7 +258,7 @@ impl SyncingChain { /// Processes the batch with the given id. /// The batch must exist and be ready for processing - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn process_batch( &mut self, network: &mut SyncNetworkContext, @@ -306,7 +306,7 @@ impl SyncingChain { } /// Processes the next ready batch, prioritizing optimistic batches over the processing target. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn process_completed_batches( &mut self, network: &mut SyncNetworkContext, @@ -416,7 +416,7 @@ impl SyncingChain { /// The block processor has completed processing a batch. This function handles the result /// of the batch processor. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn on_batch_process_result( &mut self, network: &mut SyncNetworkContext, @@ -571,7 +571,7 @@ impl SyncingChain { } } - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn reject_optimistic_batch( &mut self, network: &mut SyncNetworkContext, @@ -606,7 +606,7 @@ impl SyncingChain { /// If a previous batch has been validated and it had been re-processed, penalize the original /// peer. #[allow(clippy::modulo_one)] - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn advance_chain(&mut self, network: &mut SyncNetworkContext, validating_epoch: Epoch) { // make sure this epoch produces an advancement if validating_epoch <= self.start_epoch { @@ -710,7 +710,7 @@ impl SyncingChain { /// These events occur when a peer has successfully responded with blocks, but the blocks we /// have received are incorrect or invalid. This indicates the peer has not performed as /// intended and can result in downvoting a peer. - #[instrument(parent = None,level = "info", fields(service = self.id, network), skip_all)] + #[instrument(parent = None, fields(service = self.id, network), skip_all)] fn handle_invalid_batch( &mut self, network: &mut SyncNetworkContext, @@ -770,7 +770,7 @@ impl SyncingChain { /// This chain has been requested to start syncing. /// /// This could be new chain, or an old chain that is being resumed. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn start_syncing( &mut self, network: &mut SyncNetworkContext, @@ -809,7 +809,7 @@ impl SyncingChain { /// Add a peer to the chain. /// /// If the chain is active, this starts requesting batches from this peer. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn add_peer( &mut self, network: &mut SyncNetworkContext, @@ -822,7 +822,7 @@ impl SyncingChain { /// An RPC error has occurred. /// /// If the batch exists it is re-requested. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn inject_error( &mut self, network: &mut SyncNetworkContext, @@ -880,7 +880,7 @@ impl SyncingChain { } /// Requests the batch assigned to the given id from a given peer. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn send_batch( &mut self, network: &mut SyncNetworkContext, @@ -959,7 +959,7 @@ impl SyncingChain { } /// Returns true if this chain is currently syncing. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn is_syncing(&self) -> bool { match self.state { ChainSyncingState::Syncing => true, @@ -969,7 +969,7 @@ impl SyncingChain { /// Kickstarts the chain by sending for processing batches that are ready and requesting more /// batches if needed. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] pub fn resume( &mut self, network: &mut SyncNetworkContext, @@ -982,7 +982,7 @@ impl SyncingChain { /// Attempts to request the next required batches from the peer pool if the chain is syncing. It will exhaust the peer /// pool and left over batches until the batch buffer is reached or all peers are exhausted. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn request_batches(&mut self, network: &mut SyncNetworkContext) -> ProcessingResult { if !matches!(self.state, ChainSyncingState::Syncing) { return Ok(KeepChain); @@ -1052,7 +1052,7 @@ impl SyncingChain { /// Creates the next required batch from the chain. If there are no more batches required, /// `false` is returned. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn include_next_batch(&mut self, network: &mut SyncNetworkContext) -> Option { // don't request batches beyond the target head slot if self @@ -1115,7 +1115,7 @@ impl SyncingChain { /// This produces a string of the form: [D,E,E,E,E] /// to indicate the current buffer state of the chain. The symbols are defined on each of the /// batch states. See [BatchState::visualize] for symbol definitions. - #[instrument(parent = None,level = "info", fields(chain = self.id , service = "range_sync"), skip_all)] + #[instrument(parent = None, fields(chain = self.id , service = "range_sync"), skip_all)] fn visualize_batch_state(&self) -> String { let mut visualization_string = String::with_capacity((BATCH_BUFFER_SIZE * 3) as usize); diff --git a/beacon_node/network/src/sync/range_sync/range.rs b/beacon_node/network/src/sync/range_sync/range.rs index 2a093f6f8c..f34816d1de 100644 --- a/beacon_node/network/src/sync/range_sync/range.rs +++ b/beacon_node/network/src/sync/range_sync/range.rs @@ -103,7 +103,6 @@ where } #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -118,7 +117,6 @@ where /// chain, this may result in a different finalized chain from syncing as finalized chains are /// prioritised by peer-pool size. #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -218,7 +216,6 @@ where /// This function finds the chain that made this request. Once found, processes the result. /// This request could complete a chain or simply add to its progress. #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -254,7 +251,6 @@ where } #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -292,7 +288,6 @@ where /// A peer has disconnected. This removes the peer from any ongoing chains and mappings. A /// disconnected peer could remove a chain #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -310,7 +305,6 @@ where /// for this peer. If so we mark the batch as failed. The batch may then hit it's maximum /// retries. In this case, we need to remove the chain. #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -334,7 +328,6 @@ where /// Check to see if the request corresponds to a pending batch. If so, re-request it if possible, if there have /// been too many failed attempts for the batch, remove the chain. #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -370,7 +363,6 @@ where } #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all @@ -424,7 +416,6 @@ where /// Kickstarts sync. #[instrument(parent = None, - level = "info", fields(component = "range_sync"), name = "range_sync", skip_all diff --git a/common/task_executor/src/lib.rs b/common/task_executor/src/lib.rs index 507dfeda4e..e75aead656 100644 --- a/common/task_executor/src/lib.rs +++ b/common/task_executor/src/lib.rs @@ -108,7 +108,7 @@ impl TaskExecutor { } /// Clones the task executor adding a service name. - #[instrument(parent = None,level = "info", fields(service = service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = service_name), name = "task_executor", skip_all)] pub fn clone_with_name(&self, service_name: String) -> Self { TaskExecutor { handle_provider: self.handle_provider.clone(), @@ -124,7 +124,7 @@ impl TaskExecutor { /// The purpose of this function is to create a compile error if some function which previously /// returned `()` starts returning something else. Such a case may otherwise result in /// accidental error suppression. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn spawn_ignoring_error( &self, task: impl Future> + Send + 'static, @@ -136,7 +136,7 @@ impl TaskExecutor { /// Spawn a task to monitor the completion of another task. /// /// If the other task exits by panicking, then the monitor task will shut down the executor. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] fn spawn_monitor( &self, task_handle: impl Future> + Send + 'static, @@ -175,7 +175,7 @@ impl TaskExecutor { /// of a panic, the executor will be shut down via `self.signal_tx`. /// /// This function generates prometheus metrics on number of tasks and task duration. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn spawn(&self, task: impl Future + Send + 'static, name: &'static str) { if let Some(task_handle) = self.spawn_handle(task, name) { self.spawn_monitor(task_handle, name) @@ -191,7 +191,7 @@ impl TaskExecutor { /// This is useful in cases where the future to be spawned needs to do additional cleanup work when /// the task is completed/canceled (e.g. writing local variables to disk) or the task is created from /// some framework which does its own cleanup (e.g. a hyper server). - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn spawn_without_exit( &self, task: impl Future + Send + 'static, @@ -235,7 +235,7 @@ impl TaskExecutor { /// The task is cancelled when the corresponding async-channel is dropped. /// /// This function generates prometheus metrics on number of tasks and task duration. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn spawn_handle( &self, task: impl Future + Send + 'static, @@ -283,7 +283,7 @@ impl TaskExecutor { /// The Future returned behaves like the standard JoinHandle which can return an error if the /// task failed. /// This function generates prometheus metrics on number of tasks and task duration. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn spawn_blocking_handle( &self, task: F, @@ -332,7 +332,7 @@ impl TaskExecutor { /// a `tokio` context present in the thread-local storage due to some `rayon` funkiness. Talk to /// @paulhauner if you plan to use this function in production. He has put metrics in here to /// track any use of it, so don't think you can pull a sneaky one on him. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn block_on_dangerous( &self, future: F, @@ -368,7 +368,7 @@ impl TaskExecutor { } /// Returns a `Handle` to the current runtime. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn handle(&self) -> Option { self.handle_provider.handle() } @@ -383,7 +383,7 @@ impl TaskExecutor { } /// Get a channel to request shutting down. - #[instrument(parent = None,level = "info", fields(service = self.service_name), name = "task_executor", skip_all)] + #[instrument(parent = None, fields(service = self.service_name), name = "task_executor", skip_all)] pub fn shutdown_sender(&self) -> Sender { self.signal_tx.clone() }