-
Notifications
You must be signed in to change notification settings - Fork 1.1k
rewards-statistics-collector subsystem #9687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EclesioMeloJunior
wants to merge
171
commits into
paritytech:master
Choose a base branch
from
ChainSafe:statistics-collector
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
171 commits
Select commit
Hold shift + click to select a range
3d1c62e
chore: initial statistics subsystem
EclesioMeloJunior c70e648
Merge branch 'master' into statistics-collector
EclesioMeloJunior 4e8f90a
chore: account votes that approved candidate
EclesioMeloJunior 0bc38d0
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior a6feab9
chore: remove unneeded file
EclesioMeloJunior 788bf44
Merge branch 'master' into statistics-collector
EclesioMeloJunior 9f9d2f4
chore: add docs, get useful votes, change subsystem name
EclesioMeloJunior f4d1365
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 8637ad7
chore: start getting chunks downloads metrics
EclesioMeloJunior 0ee9a03
Merge branch 'master' into statistics-collector
EclesioMeloJunior 8bae0a8
chore: include `handle_chunks_downloaded` per session and candidate
EclesioMeloJunior b7c47ac
address comments
EclesioMeloJunior d83075a
chore: revert changes in chunks.rs
EclesioMeloJunior 2084903
Merge branch 'master' into statistics-collector
EclesioMeloJunior fac0526
Merge branch 'master' of github.com:paritytech/polkadot-sdk into stat…
EclesioMeloJunior 803ae6d
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior e4e00dc
chore: fix approval voting tests
EclesioMeloJunior a5dbccf
fix approval voting tests
EclesioMeloJunior 4f77b87
chore: fixing approval tests
EclesioMeloJunior f9f4d71
chore: include tests for collectorstats subsytem
EclesioMeloJunior 6282094
chore: include no-shows tests
EclesioMeloJunior c0f969d
include tests for chunks downloaded
EclesioMeloJunior b846ced
chore: wip using auth discovery to get peer authority id
EclesioMeloJunior 92119bf
Merge branch 'master' into statistics-collector
EclesioMeloJunior 0b186a1
deprecate macro was failing to build in recent rust versions
EclesioMeloJunior 2b2c4fa
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 7dfe19d
Merge branch 'master' into statistics-collector
EclesioMeloJunior caea9a8
feat: collect upload metrics
EclesioMeloJunior e6dcf11
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 6b7504c
chore: finish handle_chunk_upload
EclesioMeloJunior ea150e1
Merge branch 'master' into statistics-collector
EclesioMeloJunior 796f044
Merge branch 'master' into statistics-collector
EclesioMeloJunior 9ae0211
chore: including prunning based on block finalisation
EclesioMeloJunior 63e379d
chore: include tests for uploaded chunk
EclesioMeloJunior 848ba5a
chore: remove unnecessary mapping
EclesioMeloJunior 23c0512
Merge branch 'master' into statistics-collector
EclesioMeloJunior 00c661f
chore: prune when session is finalized
EclesioMeloJunior e25e99a
Merge branch 'master' into statistics-collector
EclesioMeloJunior 564e0e5
Merge branch 'master' into statistics-collector
EclesioMeloJunior bbab27b
chore: fix tests
EclesioMeloJunior 2dae7cb
chore: improve metrics collection
EclesioMeloJunior 554cd6e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior aa00e1b
chore: testing pruning capabilities
EclesioMeloJunior 3d3686e
chore: assert collected stats for pruned are discarded
EclesioMeloJunior 3ebd9c6
Merge branch 'master' into statistics-collector
EclesioMeloJunior 27d8061
Merge branch 'master' into statistics-collector
EclesioMeloJunior ec2d55d
chore: include zombienet happy-path test
EclesioMeloJunior 91230d2
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior f3bc3d9
Merge branch 'master' into statistics-collector
EclesioMeloJunior 0994734
Merge branch 'master' into statistics-collector
EclesioMeloJunior e90fb75
addressing comments
EclesioMeloJunior 5e33f9a
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 7671486
chore: implemented new pruning based on finalized blocks
EclesioMeloJunior e2e7b80
Merge branch 'master' into statistics-collector
EclesioMeloJunior e986951
chore: aggregate on tallies
EclesioMeloJunior 0a82d3f
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 4dc3efb
Merge branch 'master' into statistics-collector
EclesioMeloJunior 2016c0c
chore: including on bench + debug logs for session collected stats
EclesioMeloJunior 569176b
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 2161ced
make per validator prometheus metrics optional
EclesioMeloJunior 496c7ed
Merge branch 'master' into statistics-collector
EclesioMeloJunior ebc2f2e
Merge branch 'master' into statistics-collector
EclesioMeloJunior 5d6a592
Merge branch 'master' into statistics-collector
EclesioMeloJunior 880feab
chore: make publish_per_validator_approval_metrics a cli flag
EclesioMeloJunior 5d59954
Merge branch 'master' into statistics-collector
EclesioMeloJunior 5c166d3
Merge branch 'master' into statistics-collector
EclesioMeloJunior 67a9cb3
Merge branch 'master' into statistics-collector
EclesioMeloJunior 87b3ccc
chore: renaming subsystem
EclesioMeloJunior 55da39e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 8aecc01
chore: including approval stats submission
EclesioMeloJunior e3f757f
Merge branch 'master' into statistics-collector
EclesioMeloJunior e27fc23
chore: remove onchain impl
EclesioMeloJunior 49f783e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior f5352e2
chore: addressing comments
EclesioMeloJunior 28ce1ef
chore: addressing comments
EclesioMeloJunior cbdc2bc
chore: removing unused imports
EclesioMeloJunior 88596c2
Merge branch 'master' into statistics-collector
EclesioMeloJunior 9ffa52c
Merge branch 'master' into statistics-collector
EclesioMeloJunior 91305d9
Merge branch 'master' into statistics-collector
EclesioMeloJunior f339452
chore: fix `pre_covers_dont_stall_approval` test
EclesioMeloJunior 96494b5
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 9a37b2a
chore: solved zombienet tests
EclesioMeloJunior 34e74fc
Merge branch 'master' into statistics-collector
EclesioMeloJunior ea5eeae
chore: include rewards-statistics-collector on benchmark
EclesioMeloJunior 7b83139
Merge branch 'master' into statistics-collector
EclesioMeloJunior d26b8d5
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 963ecb5
Merge branch 'master' into statistics-collector
EclesioMeloJunior 200e615
Merge branch 'master' into statistics-collector
EclesioMeloJunior 2293e70
chore: remove charts
EclesioMeloJunior c06eb92
Merge branch 'master' into statistics-collector
EclesioMeloJunior f1e2ed7
chore: update benchmark assert values
EclesioMeloJunior b60c6ee
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 49453cb
chore: run `cargo +nightly fmt`
EclesioMeloJunior 2972131
Merge branch 'master' of github.com:paritytech/polkadot-sdk into stat…
EclesioMeloJunior 56ab9a3
Merge branch 'master' into statistics-collector
EclesioMeloJunior 7ab0893
chore: address comment
EclesioMeloJunior 24a7212
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 0f21f12
Merge branch 'master' into statistics-collector
EclesioMeloJunior 6a3dbae
Merge branch 'master' into statistics-collector
EclesioMeloJunior 43bdc6c
chore: addressing comments
EclesioMeloJunior cf1d22e
Merge branch 'master' into statistics-collector
EclesioMeloJunior 089a11f
accumulate stats w/o candidate hash
EclesioMeloJunior 7b17b6e
Merge branch 'master' into statistics-collector
EclesioMeloJunior a7d75c0
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior ad7130c
chore: fix tests
EclesioMeloJunior b9873ab
Merge branch 'master' into statistics-collector
EclesioMeloJunior c47f2bc
chore: prune availability chunks stats with session with old session …
EclesioMeloJunior f809b59
chore: changes on av-distri metrics
EclesioMeloJunior b4b8586
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 318a3cb
chore: clean up active leaves retrieve header
EclesioMeloJunior 4561d52
chore: changes to pruning
EclesioMeloJunior 629fa49
Merge branch 'master' into statistics-collector
EclesioMeloJunior fea4944
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior ff2bc65
chore: all tests passed
EclesioMeloJunior 6f5c5a8
Merge branch 'master' into statistics-collector
EclesioMeloJunior 11857eb
Merge branch 'master' into statistics-collector
EclesioMeloJunior 8e98857
chore: use chunk session index from candidate metadata from av-store
EclesioMeloJunior 27aaa6d
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 54b9fdf
chore: small changes
EclesioMeloJunior 3b753a7
Merge branch 'master' into statistics-collector
EclesioMeloJunior 7f23347
Merge branch 'master' into statistics-collector
EclesioMeloJunior 73a4e07
compilation successful
EclesioMeloJunior c2f0a0d
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior dacbd86
Merge branch 'master' into statistics-collector
EclesioMeloJunior e41fe7a
fix cargo fmt
EclesioMeloJunior 6acce36
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior ef840b4
Merge branch 'master' into statistics-collector
EclesioMeloJunior d723e64
chore: provide comments to subsystem-types `RewardsStatisticsCollecto…
EclesioMeloJunior 367e57e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 1916ecb
chore: fix toml
EclesioMeloJunior 979f031
chore: added crate to umbrella
EclesioMeloJunior 1aae955
chore: fix error on subsystem-test-helpers
EclesioMeloJunior c6e1aaa
Merge branch 'master' into statistics-collector
EclesioMeloJunior 134e246
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 4e55909
Merge branch 'master' into statistics-collector
EclesioMeloJunior 03bbc32
chore: fixing CI
EclesioMeloJunior 2a4a942
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 78918df
Merge branch 'master' into statistics-collector
EclesioMeloJunior 9bf6559
chore: removing unused imports
EclesioMeloJunior 637960e
chore: trying to fix CI
EclesioMeloJunior 91b4544
chore: rollback umbrella cargo toml adding only the new crate
EclesioMeloJunior b05c552
chore: left cargo lock untouched
EclesioMeloJunior 10bdf98
chore: finally found the problem
EclesioMeloJunior 0cbb374
Merge branch 'master' into statistics-collector
EclesioMeloJunior 70a5444
Merge branch 'master' into statistics-collector
EclesioMeloJunior 6ea5b1a
chore: include prdoc
EclesioMeloJunior 95ac8e6
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 819cf86
chore: update prdoc, update tests
EclesioMeloJunior 88a21a5
chore: check fixes
EclesioMeloJunior 0c75d4f
chore: fmt fixed
EclesioMeloJunior e8e7b62
chore: fixed more CI
EclesioMeloJunior 9b192ea
chore: fix clippy
EclesioMeloJunior 9b1777d
Merge branch 'master' into statistics-collector
EclesioMeloJunior 93af71c
chore: fix CI
EclesioMeloJunior aa11c4a
Merge branch 'master' into statistics-collector
EclesioMeloJunior 67d4c98
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior d945715
chore: useless SessionIndex import
EclesioMeloJunior 07f9abd
chore: fix cargo fmt diffs
EclesioMeloJunior 0bdc7e1
chore: fix toml simple formatting
EclesioMeloJunior 295017a
chore: unused imports
EclesioMeloJunior 4a54f0e
Merge branch 'master' into statistics-collector
EclesioMeloJunior 44a7265
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior 8379297
fix `availability_is_recovered_from_chunks_even_if_backing_group_supp…
EclesioMeloJunior 2691ccb
fix `recovers_from_only_chunks_if_pov_large`
EclesioMeloJunior 5f185b1
chore: fixed `collating_using_undying_collator`
EclesioMeloJunior 6ad3fb3
Merge branch 'master' into statistics-collector
EclesioMeloJunior afae188
chore: fix clippy diffs
EclesioMeloJunior 4ec7716
chore: fix `overseer_all_subsystems_receive_signals_and_messages`
EclesioMeloJunior d7c8645
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior b4131d5
chore: fix clippy + fmt
EclesioMeloJunior a4a71c7
Merge branch 'master' into statistics-collector
EclesioMeloJunior File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
polkadot/node/core/consensus-statistics-collector/Cargo.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| [package] | ||
| name = "polkadot-node-core-consensus-statistics-collector" | ||
| version = "6.0.0" | ||
| authors.workspace = true | ||
| edition.workspace = true | ||
| license.workspace = true | ||
| description = "The Statistics Collector subsystem. Collects Approval Voting and Approvals Distributions stats." | ||
| homepage.workspace = true | ||
| repository.workspace = true | ||
|
|
||
| [lints] | ||
| workspace = true | ||
|
|
||
| [dependencies] | ||
| fatality = { workspace = true } | ||
| futures = { workspace = true } | ||
| gum = { workspace = true, default-features = true } | ||
| thiserror = { workspace = true } | ||
|
|
||
| polkadot-node-subsystem = { workspace = true, default-features = true } | ||
| polkadot-node-subsystem-util = { workspace = true, default-features = true } | ||
| polkadot-primitives = { workspace = true, default-features = true } | ||
| polkadot-node-primitives = { workspace = true, default-features = true } | ||
|
|
||
| [dev-dependencies] | ||
| assert_matches = { workspace = true } | ||
| polkadot-node-subsystem-test-helpers = { workspace = true } | ||
| polkadot-primitives = { workspace = true, features = ["test"] } | ||
| polkadot-primitives-test-helpers = { workspace = true } | ||
| rand = { workspace = true } | ||
| rstest = { workspace = true } | ||
| sp-core = { workspace = true, default-features = true } | ||
| sp-tracing = { workspace = true } |
48 changes: 48 additions & 0 deletions
48
polkadot/node/core/consensus-statistics-collector/src/approval_voting_metrics.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| use std::collections::{HashMap, HashSet}; | ||
| use polkadot_primitives::{CandidateHash, Hash, SessionIndex, ValidatorIndex}; | ||
| use crate::View; | ||
| use crate::error::Result; | ||
|
|
||
| #[derive(Debug, Clone, Default)] | ||
| pub struct ApprovalsStats { | ||
| pub votes: HashSet<ValidatorIndex>, | ||
| } | ||
|
|
||
| impl ApprovalsStats { | ||
| pub fn new(votes: HashSet<ValidatorIndex>) -> Self { | ||
| Self { votes } | ||
| } | ||
| } | ||
|
|
||
| pub fn handle_candidate_approved( | ||
| view: &mut View, | ||
| block_hash: Hash, | ||
| candidate_hash: CandidateHash, | ||
| approvals: Vec<ValidatorIndex> | ||
| ) { | ||
| if let Some(relay_view) = view.per_relay.get_mut(&block_hash) { | ||
| relay_view.approvals_stats | ||
| .entry(candidate_hash) | ||
| .or_default() | ||
| .and_modify(|a: &mut ApprovalsStats| { | ||
| a.votes.extend(approvals.into()); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| pub fn handle_observed_no_shows( | ||
| view: &mut View, | ||
| session_index: SessionIndex, | ||
| no_show_validators: Vec<ValidatorIndex>, | ||
| ) { | ||
| view.no_shows_per_session | ||
| .entry(session_index) | ||
| .and_modify(|q: &mut HashMap<ValidatorIndex, usize>| { | ||
| for v_idx in no_show_validators { | ||
| q.entry(*v_idx) | ||
| .and_modify(|v: &mut usize| *v += 1) | ||
| .or_insert(1); | ||
| } | ||
| }) | ||
| .or_insert(HashMap::new()); | ||
| } |
51 changes: 51 additions & 0 deletions
51
polkadot/node/core/consensus-statistics-collector/src/availability_distribution_metrics.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| use std::collections::{HashMap, HashSet}; | ||
| use std::ops::Add; | ||
| use gum::CandidateHash; | ||
| use polkadot_primitives::{SessionIndex, ValidatorIndex}; | ||
| use crate::View; | ||
|
|
||
| pub struct ChunksDownloaded { | ||
| pub per_candidate: HashMap<CandidateHash, HashMap<ValidatorIndex, u64>>, | ||
| } | ||
|
|
||
| impl ChunksDownloaded { | ||
| pub fn new() -> Self { | ||
| Self { | ||
| per_candidate: Default::default(), | ||
| } | ||
| } | ||
|
|
||
| pub fn note_candidate_chunk_downloaded( | ||
| &mut self, | ||
| hash: CandidateHash, | ||
| validator_index: ValidatorIndex, | ||
| count: u64, | ||
| ) { | ||
| self.per_candidate | ||
| .entry(hash) | ||
| .or_default() | ||
| .entry(validator_index) | ||
| .or_default() | ||
| .add(count); | ||
| } | ||
| } | ||
|
|
||
| // whenever chunks are acquired throughout availability | ||
| // recovery we collect the metrics about what validator | ||
| // provided and the amount of chunks | ||
| pub fn handle_chunks_downloaded( | ||
| view: &mut View, | ||
| session_index: SessionIndex, | ||
| candidate_hash: CandidateHash, | ||
| downloads: HashMap<ValidatorIndex, u64>, | ||
| ) { | ||
| view.candidates_per_session | ||
| .entry(session_index) | ||
| .or_default() | ||
| .insert(candidate_hash); | ||
|
|
||
| for (validator_index, download_count) in downloads { | ||
| view.chunks_downloaded | ||
| .note_candidate_chunk_downloaded(candidate_hash, validator_index, download_count) | ||
| } | ||
| } |
56 changes: 56 additions & 0 deletions
56
polkadot/node/core/consensus-statistics-collector/src/error.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| // Copyright (C) Parity Technologies (UK) Ltd. | ||
| // This file is part of Polkadot. | ||
|
|
||
| // Polkadot is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
|
|
||
| // Polkadot is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
|
|
||
| // You should have received a copy of the GNU General Public License | ||
| // along with Polkadot. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //! Error types. | ||
|
|
||
| use futures::channel::oneshot; | ||
|
|
||
| use polkadot_node_subsystem::{ | ||
| SubsystemError, | ||
| }; | ||
| use polkadot_node_subsystem_util::runtime; | ||
|
|
||
| use crate::LOG_TARGET; | ||
| use fatality::Nested; | ||
|
|
||
| #[allow(missing_docs)] | ||
| #[fatality::fatality(splitable)] | ||
| pub enum Error { | ||
| #[fatal] | ||
| #[error("Receiving message from overseer failed: {0}")] | ||
| SubsystemReceive(#[source] SubsystemError), | ||
| } | ||
|
|
||
| /// General `Result` type. | ||
| pub type Result<R> = std::result::Result<R, Error>; | ||
| /// Result for non-fatal only failures. | ||
| pub type JfyiErrorResult<T> = std::result::Result<T, JfyiError>; | ||
| /// Result for fatal only failures. | ||
| pub type FatalResult<T> = std::result::Result<T, FatalError>; | ||
|
|
||
| /// Utility for eating top level errors and log them. | ||
| /// | ||
| /// We basically always want to try and continue on error. This utility function is meant to | ||
| /// consume top-level errors by simply logging them | ||
| pub fn log_error(result: Result<()>, ctx: &'static str) -> FatalResult<()> { | ||
| match result.into_nested()? { | ||
| Ok(()) => Ok(()), | ||
| Err(jfyi) => { | ||
| gum::debug!(target: LOG_TARGET, error = ?jfyi, ctx); | ||
| Ok(()) | ||
| }, | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.