fix(backend): widen TPS window to ~3.33 blocks for 300ms block time#111
Merged
Conversation
The TPS metric summed 2.5 blocks of transaction counts to approximate one second, on the assumption that average block time is ~400ms (2.5 * 400ms = 1s). With block time now ~300ms, a 2.5-block window covers only ~750ms, causing TPS to be under-reported by ~25%. Track a fourth block and sum ~3.33 blocks (3.33 * 300ms = 1s) so the metric again approximates one second of throughput. Co-authored-by: Vukašin Manojlović <8989109+iamvukasin@users.noreply.github.com>
dak-agent
Bot
requested review from
Camillebzd,
Im-Madhur-Gupta,
iamvukasin,
marcuspang and
mijovic
as code owners
July 23, 2026 16:29
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Camillebzd
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The backend TPS metric (
TPSTracker::get_tpsinbackend/src/lib/server.rs) hardcoded an assumption that average block time is ~400ms. It approximated one second of throughput by summing 2.5 blocks of transaction counts (2.5 × 400ms = 1s).With the block time change from 400ms → 300ms, a 2.5-block window now covers only ~750ms, so reported TPS is ~25% too low (
750ms / 1000ms).Modifications
block_4_txs) toTPSTracker.get_tps()now sums the three most recent full blocks plus one third of the block before them — an effective window of ~3.33 blocks (3.33 × 300ms ≈ 1s).Result
TPS again approximates one second of throughput at the new 300ms block time. No other part of the app needed changes — the frontend (block execution times, timeline, block-state tracker, transaction-volume chart) is derived entirely from live execution-event data and normalizes dynamically.
Greptile Summary
This PR adjusts the backend TPS estimate for a 300 ms block cadence. The main changes are:
TPSTracker.Confidence Score: 5/5
This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(backend): widen TPS window to ~3.33 ..." | Re-trigger Greptile