teku icon indicating copy to clipboard operation
teku copied to clipboard

Avoid loading full state/block for API requests for root

Open ajsutton opened this issue 3 years ago • 1 comments

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.

ajsutton avatar Jun 29 '22 21:06 ajsutton

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.

ajsutton avatar Jun 30 '22 21:06 ajsutton