Always verifies deserialized bank's slot and snapshot hash (#28688)
This commit is contained in:
parent
cb4c3668c7
commit
f0f108905e
|
@ -1011,6 +1011,18 @@ pub fn bank_from_snapshot_archives(
|
||||||
measure_rebuild.stop();
|
measure_rebuild.stop();
|
||||||
info!("{}", measure_rebuild);
|
info!("{}", measure_rebuild);
|
||||||
|
|
||||||
|
verify_bank_against_expected_slot_hash(
|
||||||
|
&bank,
|
||||||
|
incremental_snapshot_archive_info.as_ref().map_or(
|
||||||
|
full_snapshot_archive_info.slot(),
|
||||||
|
|incremental_snapshot_archive_info| incremental_snapshot_archive_info.slot(),
|
||||||
|
),
|
||||||
|
incremental_snapshot_archive_info.as_ref().map_or(
|
||||||
|
*full_snapshot_archive_info.hash(),
|
||||||
|
|incremental_snapshot_archive_info| *incremental_snapshot_archive_info.hash(),
|
||||||
|
),
|
||||||
|
)?;
|
||||||
|
|
||||||
let mut measure_verify = Measure::start("verify");
|
let mut measure_verify = Measure::start("verify");
|
||||||
if !bank.verify_snapshot_bank(
|
if !bank.verify_snapshot_bank(
|
||||||
test_hash_calculation,
|
test_hash_calculation,
|
||||||
|
@ -1127,18 +1139,6 @@ pub fn bank_from_latest_snapshot_archives(
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
verify_bank_against_expected_slot_hash(
|
|
||||||
&bank,
|
|
||||||
incremental_snapshot_archive_info.as_ref().map_or(
|
|
||||||
full_snapshot_archive_info.slot(),
|
|
||||||
|incremental_snapshot_archive_info| incremental_snapshot_archive_info.slot(),
|
|
||||||
),
|
|
||||||
incremental_snapshot_archive_info.as_ref().map_or(
|
|
||||||
*full_snapshot_archive_info.hash(),
|
|
||||||
|incremental_snapshot_archive_info| *incremental_snapshot_archive_info.hash(),
|
|
||||||
),
|
|
||||||
)?;
|
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
bank,
|
bank,
|
||||||
full_snapshot_archive_info,
|
full_snapshot_archive_info,
|
||||||
|
|
Loading…
Reference in New Issue