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

feat: rm "Error while parsing account" logs #84

Merged
merged 4 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion nft_ingester/src/message_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ impl MessageHandler {
match acc_parse_result {
Ok(acc_parsed) => {
let concrete = acc_parsed.result_type();

match concrete {
ProgramParseResult::TokenProgramAccount(parsing_result) => {
self.write_spl_accounts_models_to_buffer(account_info, parsing_result)
Expand Down
23 changes: 14 additions & 9 deletions usecase/src/signature_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use interface::{
};
use metrics_utils::{MetricStatus, RpcBackfillerMetricsConfig};
use solana_sdk::pubkey::Pubkey;
use tracing::info;

pub struct SignatureFetcher<T, SP, TI>
where
Expand Down Expand Up @@ -52,9 +53,10 @@ where
return Ok(());
}
let signature = signature.unwrap();
info!("Start fetching signatures...");
let mut all_signatures = match self
.rpc
.get_signatures_by_address(signature, program_id)
.get_signatures_by_address(signature.clone(), program_id)
.await
.map_err(|e| StorageError::Common(e.to_string()))
{
Expand All @@ -73,6 +75,12 @@ where
if all_signatures.is_empty() {
return Ok(());
}
info!(
"Fetched {} signatures since first persisted signature {}",
&all_signatures.len(),
signature.signature
);

// we've got a list of signatures, potentially a huge one (10s of millions)
// we need to filter out the ones we already have and ingest the rest, if any
// we need to sort them and process in batches, sorting is ascending by the slot
Expand All @@ -90,7 +98,7 @@ where
if missing_signatures.is_empty() {
continue;
}
tracing::debug!(
info!(
"Found {} missing signatures for program {}. Fetching details...",
missing_signatures.len(),
program_id
Expand Down Expand Up @@ -138,11 +146,9 @@ where
signature: Default::default(),
slot: all_signatures[batch_end - 1].slot,
};
tracing::info!(
info!(
"Ingested {} transactions. Dropping signatures for program {} before slot {}.",
tx_cnt,
program_id,
fake_key.slot
tx_cnt, program_id, fake_key.slot
);
self.data_layer
.drop_signatures_before(program_id, fake_key)
Expand All @@ -155,10 +161,9 @@ where
slot: all_signatures[all_signatures.len() - 1].slot,
};

tracing::info!(
info!(
"Finished fetching signatures for program {}. Dropping signatures before slot {}.",
program_id,
fake_key.slot
program_id, fake_key.slot
);
self.data_layer
.drop_signatures_before(program_id, fake_key)
Expand Down
Loading