state,consensus,sync: shorten span lengths

These changes help reduce the size of the resulting spans, making the
output more compact.  Together they save about 30-40 characters.
This commit is contained in:
Henry de Valence 2020-11-20 19:52:44 -08:00 committed by teor
parent 77b60f3a30
commit f0810b028d
4 changed files with 6 additions and 6 deletions

View File

@ -88,7 +88,7 @@ where
let mut redjubjub_verifier = crate::primitives::redjubjub::VERIFIER.clone();
let mut script_verifier = self.script_verifier.clone();
let span = tracing::debug_span!("tx", hash = ?tx.hash());
let span = tracing::debug_span!("tx", hash = %tx.hash());
async move {
tracing::trace!(?tx);
match &*tx {

View File

@ -86,7 +86,7 @@ impl StateService {
///
/// [1]: https://zebra.zfnd.org/dev/rfcs/0005-state-updates.html#committing-non-finalized-blocks
#[instrument(skip(self, block))]
fn queue_and_commit_non_finalized_blocks(
fn queue_and_commit_non_finalized(
&mut self,
block: Arc<Block>,
) -> oneshot::Receiver<Result<block::Hash, BoxError>> {
@ -390,7 +390,7 @@ impl Service<Request> for StateService {
metrics::counter!("state.requests", 1, "type" => "commit_block");
self.pending_utxos.check_block(&block);
let rsp_rx = self.queue_and_commit_non_finalized_blocks(block);
let rsp_rx = self.queue_and_commit_non_finalized(block);
async move {
rsp_rx
@ -408,7 +408,7 @@ impl Service<Request> for StateService {
self.pending_utxos.check_block(&block);
self.disk
.queue_and_commit_finalized_blocks(QueuedBlock { block, rsp_tx });
.queue_and_commit_finalized(QueuedBlock { block, rsp_tx });
async move {
rsp_rx

View File

@ -92,7 +92,7 @@ impl FinalizedState {
///
/// After queueing a finalized block, this method checks whether the newly
/// queued block (and any of its descendants) can be committed to the state.
pub fn queue_and_commit_finalized_blocks(&mut self, queued_block: QueuedBlock) {
pub fn queue_and_commit_finalized(&mut self, queued_block: QueuedBlock) {
let prev_hash = queued_block.block.header.previous_block_hash;
let height = queued_block.block.coinbase_height().unwrap();
self.queued_by_prev_hash.insert(prev_hash, queued_block);

View File

@ -110,7 +110,7 @@ where
/// This method waits for the network to become ready, and returns an error
/// only if the network service fails. It returns immediately after queuing
/// the request.
#[instrument(skip(self))]
#[instrument(skip(self), fields(%hash))]
pub async fn download_and_verify(&mut self, hash: block::Hash) -> Result<(), Report> {
if self.cancel_handles.contains_key(&hash) {
return Err(eyre!("duplicate hash queued for download"));