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

Gather stats on micro-fork rate

Open zone117x opened this issue 4 years ago • 4 comments

Query for micro-fork rates. This can be a one-time task using the db for the microblock mainnet deployment that has been running for a couple months now.

It would be a useful endpoint to have baked-in as well.

zone117x avatar Jul 07 '21 16:07 zone117x

@blockstack/ux-team @jasperjansz The micro-orphan rate over the last 30 days appears to be ~25%. Using the query:

with mb as (
  select * from microblocks
  where canonical = true
  and receive_timestamp > (now()::date - 30)
),
mb_total as (
  select count(*)::numeric total from mb
),
mb_orphaned as (
  select count(*)::numeric orphaned from mb
  where microblock_canonical = false
)
select total, orphaned, round(orphaned / total * 100, 2) rate
from mb_total, mb_orphaned

yields:

total orphaned rate
3825 982 25.67

zone117x avatar Jul 14 '21 19:07 zone117x

Thanks Matt. To start, we've decided to add an indicator when a transaction is in a microblock and we'll add some more guidance as to what exactly that means.

jasperjansz avatar Jul 15 '21 08:07 jasperjansz

@zone117x would it be possible to see a distribution? as in, is it a solid 25% average, or is is oscillating between 5% and 40%?

lgalabru avatar Jul 23 '21 17:07 lgalabru

remaining task: make this an endpoint anyone could consume

agraebe avatar Aug 03 '21 15:08 agraebe