stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

feat: endpoint that exposes mempool size divided by tx status

Open gregorycoppola opened this issue 3 years ago • 3 comments

This is a cross-post of https://github.com/blockstack/stacks-blockchain/issues/3001 There are issues to think about on both blockchain and API sides.

I did an analysis that shows that only around 16.5% of transactions in the mempool are actually "ready to process":

{
  total_examples: 785,
  count_map: Map(5) {
    'pending--nonce-correct' => 130,
    'pending--nonce-too-high' => 203,
    'pending--nonce-too-low' => 162,
    'dropped_replace_by_fee' => 289,
    'dropped_stale_garbage_collect' => 1
  }
}

code: https://github.com/gregorycoppola/stx-share/blob/main/mempool/nonces.js

A dashboard like https://stacksonchain.com/dashboards/Mempool/9 seems to use the 785 number, when the number of transactions that are actually ready to be processed is only 130. This leads users to have a worse impression of what is going on than is warranted.

We should figure out a way to display a more realistic number, so that the mempool doesn't look more full than it is.

Separately, some transactions are not processing. But, a more accurate assessment should help us address those as well.

gregorycoppola avatar Jan 17 '22 17:01 gregorycoppola

An API endpoint exposing these mempool stats could be very useful

rafaelcr avatar Jan 17 '22 17:01 rafaelcr

More generally, we should have some dashes that are public like https://stacksdata.info/#mempool

I think we have some private dashboards, but we should consider making more public dashboards available on the explorer, because users like looking at these.

gregorycoppola avatar Jan 17 '22 19:01 gregorycoppola

This issue (and issue https://github.com/hirosystems/stacks-blockchain-api/issues/984 to some degree) seem useful but not yet clear on what role the API should play in generating and exposing this data.

Moved into the icebox for now.

zone117x avatar Jan 18 '22 16:01 zone117x