Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review GraphQL endpoints to avoid node overload #623

Closed
xgreenx opened this issue Sep 15, 2022 · 1 comment · Fixed by #1676
Closed

Review GraphQL endpoints to avoid node overload #623

xgreenx opened this issue Sep 15, 2022 · 1 comment · Fixed by #1676
Assignees
Labels
graphql-api Affects API of the GraphQL infrastructure question Further information is requested

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Sep 15, 2022

Some GraphQL endpoints have complexity O(n), O(n^2), where n can be a number of arguments or internal data stored in the blockchain.

In the mainnet, it can affect GraphQL nodes and cause them to be stuck.

Each request should have some limitations. It can be a limitation of input or output arguments or query frequency.

The code has many simple queries (like getting block by height, transaction by id, and so on). The DevOps and infrastructure can limit the rates for those requests(for example, Apollo, but it requires investigation). So we don't need to modify the code and only care for it during cluster deployment.

We need to review all queries and decide which queries should be limited in the code(we need to implement some custom logic, maybe pagination, etc.) and which by the infra team(also, we need to decide how to do that).

@xgreenx xgreenx added question Further information is requested infrastructure graphql-api Affects API of the GraphQL labels Sep 15, 2022
@ControlCplusControlV
Copy link
Contributor

GraphQL endpoints should probably also implement some size check on request bodies to prevent that DOS vector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
graphql-api Affects API of the GraphQL infrastructure question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants