Forge a confirmed root before halting for RPC inspection (#10061)
This commit is contained in:
@ -180,7 +180,6 @@ impl BlockCommitmentCache {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
pub(crate) fn set_get_largest_confirmed_root(&mut self, root: Slot) {
|
pub(crate) fn set_get_largest_confirmed_root(&mut self, root: Slot) {
|
||||||
self.largest_confirmed_root = root;
|
self.largest_confirmed_root = root;
|
||||||
}
|
}
|
||||||
|
@ -304,6 +304,13 @@ impl Validator {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if config.dev_halt_at_slot.is_some() {
|
if config.dev_halt_at_slot.is_some() {
|
||||||
|
// Simulate a confirmed root to avoid RPC errors with CommitmentmentConfig::max() and
|
||||||
|
// to ensure RPC endpoints like getConfirmedBlock, which require a confirmed root, work
|
||||||
|
block_commitment_cache
|
||||||
|
.write()
|
||||||
|
.unwrap()
|
||||||
|
.set_get_largest_confirmed_root(bank_forks.read().unwrap().root());
|
||||||
|
|
||||||
// Park with the RPC service running, ready for inspection!
|
// Park with the RPC service running, ready for inspection!
|
||||||
warn!("Validator halted");
|
warn!("Validator halted");
|
||||||
std::thread::park();
|
std::thread::park();
|
||||||
|
Reference in New Issue
Block a user