indexer icon indicating copy to clipboard operation
indexer copied to clipboard

How to return blocks with many transactions

Open winder opened this issue 4 years ago • 1 comments

Summary

In the future, we expect to see blocks with many thousands of transactions. Returning thousands of transactions is unnecessary overhead for anyone who just wants to get the block header.

Scope/Requirements

There are a couple approaches:

  1. Simply remove the transaction array from the block header, users that want the transactions can use the transactions endpoint. Combined with #327 it is easy to verify that all transactions are accounted for.

  2. Conditionally enable the transactions-in-block feature for some deployments which can accept the overhead. With already enable some features with the --dev-mode feature, this could be more fine grained now that we have a configuration file.

Urgency/Relative Priority

It's harder to remove features than add them, so setting the precedent now would be a good idea.

winder avatar Feb 17 '21 14:02 winder

At an API level do something like this? GET /v2/blocks/{block number}?header-only=1

brianolson avatar Feb 17 '21 18:02 brianolson