Skip to content
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

fix(scan): Stop logging viewing keys in the config #8064

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
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
14 changes: 13 additions & 1 deletion zebra-scan/src/config.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
//! Configuration for blockchain scanning tasks.

use std::fmt::Debug;

use indexmap::IndexMap;
use serde::{Deserialize, Serialize};

use zebra_state::Config as DbConfig;

use crate::storage::SaplingScanningKey;

#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Eq, PartialEq, Deserialize, Serialize)]
#[serde(deny_unknown_fields, default)]
/// Configuration for scanning.
pub struct Config {
Expand All @@ -25,6 +27,16 @@ pub struct Config {
db_config: DbConfig,
}

impl Debug for Config {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_struct("Config")
// Security: don't log private keys, birthday heights might also be private
.field("sapling_keys_to_scan", &self.sapling_keys_to_scan.len())
.field("db_config", &self.db_config)
.finish()
}
}

impl Default for Config {
fn default() -> Self {
Self {
Expand Down
Loading