Block Fullness Investigation #3068
gregorycoppola
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Abstract
In early January, we initially noticed that blocks were, on average, around 15% full, or less (sheet). In other words, blocks are much less full than they could be.
This led to two questions:
The conclusions were:
Possible States of Mempool
Given that the blocks are not very full, there are then three possibilities with respect to the mempool:
The conclusion, we will see, is that the mempool does contain valid transactions, that simply aren’t being included.
Mempool Evidence
We looked at three basic kinds of evidence
Block Fullness
This graph of block fullness versus block height shows that high and low fullness blocks are interspersed.
Assuming the mempool transactions don't arrive all at once, or clear all at once, it would seem that there is a factor other than available mempool.
Mempool Analyzer
We made a tool which analyzes the mempool by creating an “unlimited size block”:
This allows us to know what the cost would be to clear the mempool.
On January 19, 2022, we measured the cost to clear all valid transactions in the mempool as:
read_count
is almost always the bottleneck, and 141543 represents about 10 blocks. In such a case, we would expect to see 10 full blocks in a row, and then an empty mempool. We don't see this. There does thus conclusively seem to be a problem.User Reports
Organizing these is TBD, but users were complaining about:
Diagnosing the Root Cause
Given that there were transactions in the mempool, we had the following hypotheses:
We investigated this by:
We realized that the following:
The conclusion from this section of the experiments is that:
This raises the prospect that miners with full blocks are actually the ones who have changed their algorithms!
Recommendations
Block emptiness is a result of the interplay between:
This correspondingly leads to two solutions:
Of these, adjusting timeouts (2) is easy, and was implemented in https://github.com/stacks-network/stacks-blockchain/releases/tag/2.05.0.1.0.
Speeding up Processing
Speeding up processing is non-trivial.
Initial profiling suggested that there wasn’t an obvious “silly” bug that could easily be rectified to improve processing speed. It was concluded that real performance improvements would be necessary.
The highest leverage point identified was:
This strategy has proven promising, with the following concrete issues open to improving the MARF:
SortitionHandleTx::descended_from
#3045It’s unclear right now what the full improvement factor will be. The faster processing will lead to fuller blocks.
Exact calculations about how many X faster we need to fill the blocks is for future work.
Productionization of Dashboards
Tools created during this investigation have been partially checked in as durable tools:
Beta Was this translation helpful? Give feedback.
All reactions