dusk-network / dusk-blockchain

Reference implementation of the DUSK Network node, written in Golang
MIT License
101 stars 47 forks source link

GQL: Search txs for blocks range #1468

Closed herr-seppia closed 1 year ago

herr-seppia commented 1 year ago

Describe what you want implemented Add a blocksrange filter to lookup transaction (similar to the range filter for blocks lookup) e.g.:

{
  transactions(blocksrange: [0,1000]) {
      blockheight
      blocktimestamp
      gasspent
      json
      txerror
      txid
  }
}

Describe "Why" this is needed In order to retrieve transaction directly without requesting the blocks

Describe alternatives you've considered Atm the same result can be achieved querying the blocks for a specific range and then request the transactions for those blocks

{
  blocks(range: [0,1000]) {
    header {
      height
      timestamp
    }
    transactions {
      gasspent
      json
      txerror
      txid
    }
  } 
}

However, this is a waste of bandwidth, because this returns information even for blocks that doesn't have transaction

Additional context N/A