state: add additional traces to block commit logic
This commit is contained in:
parent
36cd76d590
commit
3192a5008d
|
|
@ -103,6 +103,7 @@ impl StateService {
|
||||||
// been queued but not yet committed to the state fails the older
|
// been queued but not yet committed to the state fails the older
|
||||||
// request and replaces it with the newer request.
|
// request and replaces it with the newer request.
|
||||||
let rsp_rx = if let Some(queued_block) = self.queued_blocks.get_mut(&hash) {
|
let rsp_rx = if let Some(queued_block) = self.queued_blocks.get_mut(&hash) {
|
||||||
|
tracing::debug!("replacing older queued request with new request");
|
||||||
let (mut rsp_tx, rsp_rx) = oneshot::channel();
|
let (mut rsp_tx, rsp_rx) = oneshot::channel();
|
||||||
std::mem::swap(&mut queued_block.rsp_tx, &mut rsp_tx);
|
std::mem::swap(&mut queued_block.rsp_tx, &mut rsp_tx);
|
||||||
let _ = rsp_tx.send(Err("replaced by newer request".into()));
|
let _ = rsp_tx.send(Err("replaced by newer request".into()));
|
||||||
|
|
@ -114,12 +115,14 @@ impl StateService {
|
||||||
};
|
};
|
||||||
|
|
||||||
if !self.can_fork_chain_at(&parent_hash) {
|
if !self.can_fork_chain_at(&parent_hash) {
|
||||||
|
tracing::trace!("unready to verify, returning early");
|
||||||
return rsp_rx;
|
return rsp_rx;
|
||||||
}
|
}
|
||||||
|
|
||||||
self.process_queued(parent_hash);
|
self.process_queued(parent_hash);
|
||||||
|
|
||||||
while self.mem.best_chain_len() > crate::constants::MAX_BLOCK_REORG_HEIGHT {
|
while self.mem.best_chain_len() > crate::constants::MAX_BLOCK_REORG_HEIGHT {
|
||||||
|
tracing::trace!("finalizing block past the reorg limit");
|
||||||
let finalized = self.mem.finalize();
|
let finalized = self.mem.finalize();
|
||||||
self.disk
|
self.disk
|
||||||
.commit_finalized_direct(finalized)
|
.commit_finalized_direct(finalized)
|
||||||
|
|
@ -131,6 +134,7 @@ impl StateService {
|
||||||
"Finalized state must have at least one block before committing non-finalized state",
|
"Finalized state must have at least one block before committing non-finalized state",
|
||||||
));
|
));
|
||||||
|
|
||||||
|
tracing::trace!("finished processing queued block");
|
||||||
rsp_rx
|
rsp_rx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue