From dc419c3688aa9923f6064ca6adda32d8bcdd2942 Mon Sep 17 00:00:00 2001 From: danielxiangzl Date: Thu, 16 Apr 2026 13:30:16 -0700 Subject: [PATCH 1/2] [consensus] Fix BATCH_NUM_PER_BLOCK histogram buckets Use PROOF_COUNT_BUCKETS instead of TRANSACTION_COUNT_BUCKETS for the batch-count-per-block metric. The old buckets were designed for transaction counts (exponential from 1.5 up to thousands), while batch counts per block are typically in the tens to low hundreds. Co-Authored-By: Claude Opus 4.6 (1M context) --- consensus/src/quorum_store/counters.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/src/quorum_store/counters.rs b/consensus/src/quorum_store/counters.rs index 0311c89524d..e8e2fe844ca 100644 --- a/consensus/src/quorum_store/counters.rs +++ b/consensus/src/quorum_store/counters.rs @@ -166,7 +166,7 @@ pub static BATCH_NUM_PER_BLOCK: Lazy = Lazy::new(|| { "quorum_store_batch_num_per_block", "Histogram for the number of batches per (committed) blocks.", &["type"], - TRANSACTION_COUNT_BUCKETS.clone(), + PROOF_COUNT_BUCKETS.clone(), ) .unwrap() }); From 15fbda3f4f31e6bd65f4853b083be43d520ede6d Mon Sep 17 00:00:00 2001 From: danielxiangzl Date: Mon, 20 Apr 2026 13:01:19 -0700 Subject: [PATCH 2/2] [consensus] Fix buckets for proof/batch count histograms Address review comment: NUM_BATCHES_WITHOUT_PROOF_OF_STORE and PROOF_SIZE_WHEN_PULL measure proof/batch counts (small integers), so they should use PROOF_COUNT_BUCKETS rather than the transaction-scaled TRANSACTION_COUNT_BUCKETS. Co-Authored-By: Claude Opus 4.7 (1M context) --- consensus/src/quorum_store/counters.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/src/quorum_store/counters.rs b/consensus/src/quorum_store/counters.rs index e8e2fe844ca..7e38d0f9995 100644 --- a/consensus/src/quorum_store/counters.rs +++ b/consensus/src/quorum_store/counters.rs @@ -379,7 +379,7 @@ pub static NUM_BATCHES_WITHOUT_PROOF_OF_STORE: Lazy = Lazy::new(|| { register_histogram!( "num_batches_without_proof_of_store", "Histogram for the number of batches without proof of store in proof manager", - TRANSACTION_COUNT_BUCKETS.clone(), + PROOF_COUNT_BUCKETS.clone(), ) .unwrap() }); @@ -408,7 +408,7 @@ pub static PROOF_SIZE_WHEN_PULL: Lazy = Lazy::new(|| { register_histogram!( "quorum_store_proof_size_when_pull", "Histogram for the number of proof-of-store per block when pulled for consensus.", - TRANSACTION_COUNT_BUCKETS.clone(), + PROOF_COUNT_BUCKETS.clone(), ) .unwrap() });