|
@@ -120,10 +120,7 @@ fn do_get_first_error<T, Tx: SVMTransaction>(
|
|
|
if first_err.is_none() {
|
|
if first_err.is_none() {
|
|
|
first_err = Some((Err(err.clone()), *transaction.signature()));
|
|
first_err = Some((Err(err.clone()), *transaction.signature()));
|
|
|
}
|
|
}
|
|
|
- warn!(
|
|
|
|
|
- "Unexpected validator error: {:?}, transaction: {:?}",
|
|
|
|
|
- err, transaction
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ warn!("Unexpected validator error: {err:?}, transaction: {transaction:?}");
|
|
|
datapoint_error!(
|
|
datapoint_error!(
|
|
|
"validator_process_entry_error",
|
|
"validator_process_entry_error",
|
|
|
(
|
|
(
|
|
@@ -644,7 +641,7 @@ pub fn process_entries_for_tests(
|
|
|
&ignored_prioritization_fee_cache,
|
|
&ignored_prioritization_fee_cache,
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- debug!("process_entries: {:?}", batch_timing);
|
|
|
|
|
|
|
+ debug!("process_entries: {batch_timing:?}");
|
|
|
result
|
|
result
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1002,10 +999,7 @@ pub fn process_blockstore_from_root(
|
|
|
let bank = bank_forks.read().unwrap().root_bank();
|
|
let bank = bank_forks.read().unwrap().root_bank();
|
|
|
#[cfg(feature = "dev-context-only-utils")]
|
|
#[cfg(feature = "dev-context-only-utils")]
|
|
|
if let Some(hash_overrides) = &opts.hash_overrides {
|
|
if let Some(hash_overrides) = &opts.hash_overrides {
|
|
|
- info!(
|
|
|
|
|
- "Will override following slots' hashes: {:#?}",
|
|
|
|
|
- hash_overrides
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ info!("Will override following slots' hashes: {hash_overrides:#?}");
|
|
|
bank.set_hash_overrides(hash_overrides.clone());
|
|
bank.set_hash_overrides(hash_overrides.clone());
|
|
|
}
|
|
}
|
|
|
if opts.no_block_cost_limits {
|
|
if opts.no_block_cost_limits {
|
|
@@ -1018,7 +1012,7 @@ pub fn process_blockstore_from_root(
|
|
|
(bank.slot(), bank.hash())
|
|
(bank.slot(), bank.hash())
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- info!("Processing ledger from slot {}...", start_slot);
|
|
|
|
|
|
|
+ info!("Processing ledger from slot {start_slot}...");
|
|
|
let now = Instant::now();
|
|
let now = Instant::now();
|
|
|
|
|
|
|
|
// Ensure start_slot is rooted for correct replay; also ensure start_slot and
|
|
// Ensure start_slot is rooted for correct replay; also ensure start_slot and
|
|
@@ -1035,13 +1029,13 @@ pub fn process_blockstore_from_root(
|
|
|
.expect("Couldn't mark start_slot as connected during startup")
|
|
.expect("Couldn't mark start_slot as connected during startup")
|
|
|
} else {
|
|
} else {
|
|
|
info!(
|
|
info!(
|
|
|
- "Start slot {} isn't a root, and won't be updated due to secondary blockstore access",
|
|
|
|
|
- start_slot
|
|
|
|
|
|
|
+ "Start slot {start_slot} isn't a root, and won't be updated due to secondary \
|
|
|
|
|
+ blockstore access"
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if let Ok(Some(highest_slot)) = blockstore.highest_slot() {
|
|
if let Ok(Some(highest_slot)) = blockstore.highest_slot() {
|
|
|
- info!("ledger holds data through slot {}", highest_slot);
|
|
|
|
|
|
|
+ info!("ledger holds data through slot {highest_slot}");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
let mut timing = ExecuteTimings::default();
|
|
let mut timing = ExecuteTimings::default();
|
|
@@ -1068,10 +1062,7 @@ pub fn process_blockstore_from_root(
|
|
|
//
|
|
//
|
|
|
// If the ledger has any data at all, the snapshot was likely taken at
|
|
// If the ledger has any data at all, the snapshot was likely taken at
|
|
|
// a slot that is not within the range of ledger min/max slot(s).
|
|
// a slot that is not within the range of ledger min/max slot(s).
|
|
|
- warn!(
|
|
|
|
|
- "Starting slot {} is not in Blockstore, unable to process",
|
|
|
|
|
- start_slot
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ warn!("Starting slot {start_slot} is not in Blockstore, unable to process");
|
|
|
(0, 0)
|
|
(0, 0)
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -1087,7 +1078,7 @@ pub fn process_blockstore_from_root(
|
|
|
("forks", bank_forks.read().unwrap().banks().len(), i64),
|
|
("forks", bank_forks.read().unwrap().banks().len(), i64),
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- info!("ledger processing timing: {:?}", timing);
|
|
|
|
|
|
|
+ info!("ledger processing timing: {timing:?}");
|
|
|
{
|
|
{
|
|
|
let bank_forks = bank_forks.read().unwrap();
|
|
let bank_forks = bank_forks.read().unwrap();
|
|
|
let mut bank_slots = bank_forks.banks().keys().copied().collect::<Vec<_>>();
|
|
let mut bank_slots = bank_forks.banks().keys().copied().collect::<Vec<_>>();
|
|
@@ -1604,8 +1595,8 @@ fn confirm_slot_entries(
|
|
|
starting_transaction_index: entry_tx_starting_index,
|
|
starting_transaction_index: entry_tx_starting_index,
|
|
|
}) {
|
|
}) {
|
|
|
warn!(
|
|
warn!(
|
|
|
- "Slot {}, entry {} entry_notification_sender send failed: {:?}",
|
|
|
|
|
- slot, entry_index, err
|
|
|
|
|
|
|
+ "Slot {slot}, entry {entry_index} entry_notification_sender send failed: \
|
|
|
|
|
+ {err:?}"
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1617,12 +1608,8 @@ fn confirm_slot_entries(
|
|
|
})
|
|
})
|
|
|
.sum::<usize>();
|
|
.sum::<usize>();
|
|
|
trace!(
|
|
trace!(
|
|
|
- "Fetched entries for slot {}, num_entries: {}, num_shreds: {}, num_txs: {}, slot_full: {}",
|
|
|
|
|
- slot,
|
|
|
|
|
- num_entries,
|
|
|
|
|
- num_shreds,
|
|
|
|
|
- num_txs,
|
|
|
|
|
- slot_full,
|
|
|
|
|
|
|
+ "Fetched entries for slot {slot}, num_entries: {num_entries}, num_shreds: {num_shreds}, \
|
|
|
|
|
+ num_txs: {num_txs}, slot_full: {slot_full}",
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if !skip_verification {
|
|
if !skip_verification {
|
|
@@ -1653,7 +1640,7 @@ fn confirm_slot_entries(
|
|
|
recyclers.clone(),
|
|
recyclers.clone(),
|
|
|
);
|
|
);
|
|
|
if entry_state.status() == EntryVerificationStatus::Failure {
|
|
if entry_state.status() == EntryVerificationStatus::Failure {
|
|
|
- warn!("Ledger proof of history failed at slot: {}", slot);
|
|
|
|
|
|
|
+ warn!("Ledger proof of history failed at slot: {slot}");
|
|
|
return Err(BlockError::InvalidEntryHash.into());
|
|
return Err(BlockError::InvalidEntryHash.into());
|
|
|
}
|
|
}
|
|
|
Some(entry_state)
|
|
Some(entry_state)
|
|
@@ -1830,7 +1817,7 @@ fn process_next_slots(
|
|
|
let next_meta = blockstore
|
|
let next_meta = blockstore
|
|
|
.meta(*next_slot)
|
|
.meta(*next_slot)
|
|
|
.map_err(|err| {
|
|
.map_err(|err| {
|
|
|
- warn!("Failed to load meta for slot {}: {:?}", next_slot, err);
|
|
|
|
|
|
|
+ warn!("Failed to load meta for slot {next_slot}: {err:?}");
|
|
|
BlockstoreProcessorError::FailedToLoadMeta
|
|
BlockstoreProcessorError::FailedToLoadMeta
|
|
|
})?
|
|
})?
|
|
|
.unwrap();
|
|
.unwrap();
|
|
@@ -1881,8 +1868,8 @@ fn load_frozen_forks(
|
|
|
let mut root = bank_forks.read().unwrap().root();
|
|
let mut root = bank_forks.read().unwrap().root();
|
|
|
let max_root = std::cmp::max(root, blockstore_max_root);
|
|
let max_root = std::cmp::max(root, blockstore_max_root);
|
|
|
info!(
|
|
info!(
|
|
|
- "load_frozen_forks() latest root from blockstore: {}, max_root: {}",
|
|
|
|
|
- blockstore_max_root, max_root,
|
|
|
|
|
|
|
+ "load_frozen_forks() latest root from blockstore: {blockstore_max_root}, max_root: \
|
|
|
|
|
+ {max_root}",
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
// The total number of slots processed
|
|
// The total number of slots processed
|
|
@@ -2173,15 +2160,14 @@ pub fn process_single_slot(
|
|
|
Ok(())
|
|
Ok(())
|
|
|
})
|
|
})
|
|
|
.map_err(|err| {
|
|
.map_err(|err| {
|
|
|
- warn!("slot {} failed to verify: {}", slot, err);
|
|
|
|
|
|
|
+ warn!("slot {slot} failed to verify: {err}");
|
|
|
if blockstore.is_primary_access() {
|
|
if blockstore.is_primary_access() {
|
|
|
blockstore
|
|
blockstore
|
|
|
.set_dead_slot(slot)
|
|
.set_dead_slot(slot)
|
|
|
.expect("Failed to mark slot as dead in blockstore");
|
|
.expect("Failed to mark slot as dead in blockstore");
|
|
|
} else {
|
|
} else {
|
|
|
info!(
|
|
info!(
|
|
|
- "Failed slot {} won't be marked dead due to being secondary blockstore access",
|
|
|
|
|
- slot
|
|
|
|
|
|
|
+ "Failed slot {slot} won't be marked dead due to being secondary blockstore access"
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
err
|
|
err
|
|
@@ -2191,15 +2177,21 @@ pub fn process_single_slot(
|
|
|
result?
|
|
result?
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- let block_id = blockstore.check_last_fec_set_and_get_block_id(slot, bank.hash(), &bank.feature_set)
|
|
|
|
|
|
|
+ let block_id = blockstore
|
|
|
|
|
+ .check_last_fec_set_and_get_block_id(slot, bank.hash(), &bank.feature_set)
|
|
|
.inspect_err(|err| {
|
|
.inspect_err(|err| {
|
|
|
- warn!("slot {} failed last fec set checks: {}", slot, err);
|
|
|
|
|
|
|
+ warn!("slot {slot} failed last fec set checks: {err}");
|
|
|
if blockstore.is_primary_access() {
|
|
if blockstore.is_primary_access() {
|
|
|
- blockstore.set_dead_slot(slot).expect("Failed to mark slot as dead in blockstore");
|
|
|
|
|
|
|
+ blockstore
|
|
|
|
|
+ .set_dead_slot(slot)
|
|
|
|
|
+ .expect("Failed to mark slot as dead in blockstore");
|
|
|
} else {
|
|
} else {
|
|
|
- info!("Failed last fec set checks slot {slot} won't be marked dead due to being secondary blockstore access");
|
|
|
|
|
|
|
+ info!(
|
|
|
|
|
+ "Failed last fec set checks slot {slot} won't be marked dead due to being \
|
|
|
|
|
+ secondary blockstore access"
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
- })?;
|
|
|
|
|
|
|
+ })?;
|
|
|
bank.set_block_id(block_id);
|
|
bank.set_block_id(block_id);
|
|
|
bank.freeze(); // all banks handled by this routine are created from complete slots
|
|
bank.freeze(); // all banks handled by this routine are created from complete slots
|
|
|
|
|
|
|
@@ -2264,11 +2256,7 @@ impl TransactionStatusSender {
|
|
|
transaction_indexes,
|
|
transaction_indexes,
|
|
|
}))
|
|
}))
|
|
|
{
|
|
{
|
|
|
- trace!(
|
|
|
|
|
- "Slot {} transaction_status send batch failed: {:?}",
|
|
|
|
|
- slot,
|
|
|
|
|
- e
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ trace!("Slot {slot} transaction_status send batch failed: {e:?}");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2278,10 +2266,7 @@ impl TransactionStatusSender {
|
|
|
.send(TransactionStatusMessage::Freeze(bank.clone()))
|
|
.send(TransactionStatusMessage::Freeze(bank.clone()))
|
|
|
{
|
|
{
|
|
|
let slot = bank.slot();
|
|
let slot = bank.slot();
|
|
|
- warn!(
|
|
|
|
|
- "Slot {slot} transaction_status send freeze message failed: {:?}",
|
|
|
|
|
- e
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ warn!("Slot {slot} transaction_status send freeze message failed: {e:?}");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2608,7 +2593,7 @@ pub mod tests {
|
|
|
|
|
|
|
|
// Create a new ledger with slot 0 full of ticks
|
|
// Create a new ledger with slot 0 full of ticks
|
|
|
let (ledger_path, mut blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
let (ledger_path, mut blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
|
|
|
|
|
let blockstore = Blockstore::open(ledger_path.path()).unwrap();
|
|
let blockstore = Blockstore::open(ledger_path.path()).unwrap();
|
|
|
|
|
|
|
@@ -2681,7 +2666,7 @@ pub mod tests {
|
|
|
|
|
|
|
|
// Create a new ledger with slot 0 full of ticks
|
|
// Create a new ledger with slot 0 full of ticks
|
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
let mut last_entry_hash = blockhash;
|
|
let mut last_entry_hash = blockhash;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -2722,8 +2707,8 @@ pub mod tests {
|
|
|
last_slot1_entry_hash,
|
|
last_slot1_entry_hash,
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- info!("last_fork1_entry.hash: {:?}", last_fork1_entry_hash);
|
|
|
|
|
- info!("last_fork2_entry.hash: {:?}", last_fork2_entry_hash);
|
|
|
|
|
|
|
+ info!("last_fork1_entry.hash: {last_fork1_entry_hash:?}");
|
|
|
|
|
+ info!("last_fork2_entry.hash: {last_fork2_entry_hash:?}");
|
|
|
|
|
|
|
|
blockstore.set_roots([0, 1, 4].iter()).unwrap();
|
|
blockstore.set_roots([0, 1, 4].iter()).unwrap();
|
|
|
|
|
|
|
@@ -2760,7 +2745,7 @@ pub mod tests {
|
|
|
|
|
|
|
|
// Create a new ledger with slot 0 full of ticks
|
|
// Create a new ledger with slot 0 full of ticks
|
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
let mut last_entry_hash = blockhash;
|
|
let mut last_entry_hash = blockhash;
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -2801,8 +2786,8 @@ pub mod tests {
|
|
|
last_slot1_entry_hash,
|
|
last_slot1_entry_hash,
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- info!("last_fork1_entry.hash: {:?}", last_fork1_entry_hash);
|
|
|
|
|
- info!("last_fork2_entry.hash: {:?}", last_fork2_entry_hash);
|
|
|
|
|
|
|
+ info!("last_fork1_entry.hash: {last_fork1_entry_hash:?}");
|
|
|
|
|
+ info!("last_fork2_entry.hash: {last_fork2_entry_hash:?}");
|
|
|
|
|
|
|
|
blockstore.set_roots([0, 1].iter()).unwrap();
|
|
blockstore.set_roots([0, 1].iter()).unwrap();
|
|
|
|
|
|
|
@@ -2848,7 +2833,7 @@ pub mod tests {
|
|
|
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
|
|
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
|
|
|
let ticks_per_slot = genesis_config.ticks_per_slot;
|
|
let ticks_per_slot = genesis_config.ticks_per_slot;
|
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
slot 0
|
|
slot 0
|
|
@@ -2895,7 +2880,7 @@ pub mod tests {
|
|
|
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
|
|
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
|
|
|
let ticks_per_slot = genesis_config.ticks_per_slot;
|
|
let ticks_per_slot = genesis_config.ticks_per_slot;
|
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
slot 0
|
|
slot 0
|
|
@@ -2955,7 +2940,7 @@ pub mod tests {
|
|
|
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
|
|
let GenesisConfigInfo { genesis_config, .. } = create_genesis_config(10_000);
|
|
|
let ticks_per_slot = genesis_config.ticks_per_slot;
|
|
let ticks_per_slot = genesis_config.ticks_per_slot;
|
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
let (ledger_path, blockhash) = create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
slot 0
|
|
slot 0
|
|
@@ -3116,7 +3101,7 @@ pub mod tests {
|
|
|
genesis_config.poh_config.hashes_per_tick = Some(hashes_per_tick);
|
|
genesis_config.poh_config.hashes_per_tick = Some(hashes_per_tick);
|
|
|
let (ledger_path, mut last_entry_hash) =
|
|
let (ledger_path, mut last_entry_hash) =
|
|
|
create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
create_new_tmp_ledger_auto_delete!(&genesis_config);
|
|
|
- debug!("ledger_path: {:?}", ledger_path);
|
|
|
|
|
|
|
+ debug!("ledger_path: {ledger_path:?}");
|
|
|
|
|
|
|
|
let deducted_from_mint = 3;
|
|
let deducted_from_mint = 3;
|
|
|
let mut entries = vec![];
|
|
let mut entries = vec![];
|
|
@@ -4341,7 +4326,7 @@ pub mod tests {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
.collect();
|
|
.collect();
|
|
|
- info!("paying iteration {}", i);
|
|
|
|
|
|
|
+ info!("paying iteration {i}");
|
|
|
process_entries_for_tests_without_scheduler(&bank, entries).expect("paying failed");
|
|
process_entries_for_tests_without_scheduler(&bank, entries).expect("paying failed");
|
|
|
|
|
|
|
|
let entries: Vec<_> = (0..NUM_TRANSFERS)
|
|
let entries: Vec<_> = (0..NUM_TRANSFERS)
|
|
@@ -4364,7 +4349,7 @@ pub mod tests {
|
|
|
})
|
|
})
|
|
|
.collect();
|
|
.collect();
|
|
|
|
|
|
|
|
- info!("refunding iteration {}", i);
|
|
|
|
|
|
|
+ info!("refunding iteration {i}");
|
|
|
process_entries_for_tests_without_scheduler(&bank, entries).expect("refunding failed");
|
|
process_entries_for_tests_without_scheduler(&bank, entries).expect("refunding failed");
|
|
|
|
|
|
|
|
// advance to next block
|
|
// advance to next block
|