ChainSafe / ChainSafe/lodestar

High outliers for some REST API responses

Open
#6,691 2 comments 0 reactions 0 assignees View on GitHub
meta-investigate scope-performance
Dominant language
TypeScript
Stars
1.4k
Forks
483
Avg merge
1d 16h
Merged PRs (30d)
150

Description

Based on the metrics, it looks like some REST API responses have pretty high outliers while the average responses times are quite low.

## Requests pulling data from network

Might be related to the API pulling (or pushing) data from the network

### [getPeers](https://github.com/ChainSafe/lodestar/blob/05fe0ac00d9de61dc6e85225ef2d1c5e27ab714d/packages/beacon-node/src/api/impl/node/index.ts#L25)

_(needs more buckets between 100ms-1s)_

![image](https://github.com/ChainSafe/lodestar/assets/38436224/a989b411-79aa-481f-90d9-eecc827c980b)

### [prepareBeaconCommitteeSubnet](https://github.com/ChainSafe/lodestar/blob/05fe0ac00d9de61dc6e85225ef2d1c5e27ab714d/packages/beacon-node/src/api/impl/validator/index.ts#L1200)

_(needs more buckets between 100ms-1s)_

![image](https://github.com/ChainSafe/lodestar/assets/38436224/bb041089-28d2-4338-8f54-4a4c6337de9e)

## Requests pulling data from state

While other APIs that involve just pulling data from head state don't have this issue

### [getStateFinalityCheckpoints](https://github.com/ChainSafe/lodestar/blob/05fe0ac00d9de61dc6e85225ef2d1c5e27ab714d/packages/beacon-node/src/api/impl/beacon/state/index.ts#L70)

![image](https://github.com/ChainSafe/lodestar/assets/38436224/08b440e9-7fcb-4d39-a8aa-76698e84b68c)

### [getStateValidators](https://github.com/ChainSafe/lodestar/blob/05fe0ac00d9de61dc6e85225ef2d1c5e27ab714d/packages/beacon-node/src/api/impl/beacon/state/index.ts#L83)

_(querying for low validator count)_

![image](https://github.com/ChainSafe/lodestar/assets/38436224/83f44b81-5814-4324-bdd8-be4aeb1f9f2b)

Contributor guide

Open the contributing guide

Research direction

Start by inspecting the linked implementations in packages/beacon-node/src/api/impl/node/index.ts at getPeers, packages/beacon-node/src/api/impl/validator/index.ts at prepareBeaconCommitteeSubnet, and the state API entries in packages/beacon-node/src/api/impl/beacon/state/index.ts. Compare their response-time metrics and bucket coverage, then verify that the high outliers are explained or corrected and that the resulting distributions are observable.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, observability-sre, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.