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

root_validation_failures fix #9

Open
wants to merge 7 commits into
base: triton
Choose a base branch
from
Open
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
16 changes: 13 additions & 3 deletions src/monitor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ async fn load_accounts_with_infinite_retry(
}

async fn validate_tree_roots(rpc_client: &RpcClient, db_roots: Vec<(Pubkey, Hash)>) {
let mut root_validation_errors = 0;
for chunk in db_roots.chunks(CHUNK_SIZE) {
let pubkeys = chunk.iter().map(|(pubkey, _)| pubkey.clone()).collect();
let accounts = load_accounts_with_infinite_retry(rpc_client, pubkeys).await;
Expand All @@ -188,11 +189,20 @@ async fn validate_tree_roots(rpc_client: &RpcClient, db_roots: Vec<(Pubkey, Hash
db_hash,
account_roots
);
return;
root_validation_errors += 1;
let pubkey_str = pubkey.to_string();
statsd_count!("root_validation_failures", 1, "pubkey" => &pubkey_str);
}
}
}
metric! {
statsd_count!("root_validation_success", 1);

if root_validation_errors > 0 {
metric! {
statsd_gauge!("root_validation_success", 0);
}
} else {
metric! {
statsd_gauge!("root_validation_success", 1);
}
}
}