-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check: set lastBlockTime in PrepareRequest handler, fix #55 #56
Conversation
288fc24
to
4c7e221
Compare
Rebased. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #56 +/- ##
==========================================
+ Coverage 58.21% 58.31% +0.09%
==========================================
Files 32 32
Lines 2257 2262 +5
==========================================
+ Hits 1314 1319 +5
Misses 859 859
Partials 84 84 ☔ View full report in Codecov by Sentry. |
279e52e
to
42d6f59
Compare
As we remember from #56 (comment) this patch works perfectly for the case of constant low/moderate load, the difference is rather obvious and for the good. Let's concentrate on less positive side of it that was left as "unknown" three years ago. All tests below are using 50K memory pool (and are limited by it in many cases), BoltDB as the DB and 30 workers pushing as many transactions as they can. Starting with the simple case, single node: It's obvious that we have zero communication overhead in this case, but one can notice that the patched version still shaves off some milliseconds from the block time leading to slightly better average TPS results (even if some blocks drop below the line which can happen from test to test irrespective of this patch): Moving on to four nodes, 5s block time and no delays: To make things more interesting we can drop block time to 1s: In this case nodes aren't perfectly synchronized and they can't consume 50K transactions in one second which leads to lower number of transactions in each block: But notice that block time is more stable here and TPS is actually better: Which is connected to the fact of more stable block time with memory pool having some spare slots. Now to more complex things, we're adding 200ms delay and run with 5s block time: It's rather obvious that block times are much better here (as expected and even if we're to forget about CV), but TPS picture is similar to the one in #56 (comment): There is a degradation. And we can clearly see the tick-tock pattern in TPS which directly follows from the tick-tock in TPB: And now I can finally explain this. This network has problems with transaction propagation and consensus, in general it can consume ~50K transactions in 5s, but accepting a block takes time, so once it flushes 50K block nodes have empty memory pools and they're adjusting timers for consensus delay leaving very little time for the next block, so when time comes to make it we don't have a lot of transactions in pools, so we end up with ~empty block, but the next one has enough overall time to fill up memory pool again, then it's flushed with 50K transactions and the cycle repeats. It's not the first time we see this pattern in various cases, but here longer block time of non-patched version just allows to collect more transactions. So we have a clear trade-off between average TPS and latency (since blocks are delayed for longer time without this patch). But this is a memory pool limit effect again, to avoid it we can drop block time to 1s (with the same 200ms delay): It's a bit better and it's more stable. And that happens because this time it's master that is doing tick-tock again: So overall I can say that:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise this change looks legit to me.
It's the earliest point, if a view change happens the timer is reset (because new view comes with a new set of transactions, potentially picking up ones received between views). Signed-off-by: Roman Khimov <[email protected]>
42d6f59
to
b3c1c3b
Compare
It's the earliest point, if a view change happens the timer is reset (because
new view comes with a new set of transactions, potentially picking up ones
received between views).