teku
teku copied to clipboard
Avoid loading full state/block for API requests for root
Description
Requests to /eth/v1/beacon/states/:stateId/root or /eth/v1/beacon/blocks/:blockId/root should try to avoid loading the full state or block to calculate the root from. Generally the root is directly available from the database or protoarray.
We don't actually have a slot to state root mapping in our database so likely can't optimise this for finalized states. Could get state root from the protoarray for non-finalised but those would be quick to compute anyway.