Granola-Team / mina-indexer

The Mina Indexer is a re-imagined version of the software collectively called the "Mina archive node."
Apache License 2.0
17 stars 10 forks source link

Feetransfers does not support filtering to exclude coinbase rewards #1094

Open n1tranquilla opened 1 month ago

n1tranquilla commented 1 month ago

We're interested in querying those two separately or together.

trevorbernard commented 1 month ago

@n1tranquilla If you look at it from the context of an internal command, then it makes sense include both but if we use the terminology of "Fee Transfer" then a coinbase is not a fee transfer but a reward. The reason why we've separated it so far is because that's what ME does and that's how the API looks with the Mina node.

robinbb commented 1 month ago

Do we need to exclude coinbase rewards? Do we want fee transfers, or internal commands?

n1tranquilla commented 1 month ago

To display fees here, I have to filter out coinbase rewards in the javascript. Here is a case where I want to display fees, not coinbase rewards.

robinbb commented 1 month ago

Not sure if this should be back-end. Is it already done in the front-end?

n1tranquilla commented 1 month ago

I think it should be a GQL query option, but i'm content for now, to filter using magic number (ie < 720 MINA)

robinbb commented 1 month ago

That filter will cause the most interesting of fees to be excluded.

n1tranquilla commented 1 month ago

That's why we need the filter for https://minasearch.com/analytics/commands/internal. We want to get all fees, except coinbase rewards. This filtering (done client-side) is just a guess as there are likely no fees that ever approach block reward levels. But if there are, i'm filtering them out (hence the need for server-side filter).

@trevorbernard can I transfer this to mina-indexer?

trevorbernard commented 1 month ago

To display fees here, I have to filter out coinbase rewards in the javascript. Here is a case where I want to display fees, not coinbase rewards.

But why are we filtering them out? The link says internal_commands for which the Coinbase reward is one.

trevorbernard commented 1 month ago

This is something we can support:

query MyQuery {
  feetransfers(query: {type_nin: ["Coinbase"]}) {
    blockHeight
    canonical
    dateTime
    fee
    recipient
    type
  }
}
trevorbernard commented 1 month ago

Alternatively we just don't return coinbase rewards in that endpoint and add internal_commands endpoint