Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

feat: check batch request limit and RPC method rate limit #596

Merged
merged 5 commits into from
Jan 9, 2023

Conversation

RetricSu
Copy link
Contributor

@RetricSu RetricSu commented Jan 6, 2023

  • add new config in rate-limit-config.json: "batch_limit": <number, array max length of batch request>
  • fix the rate-limit count for single batch request, previously we only counted one for each batch request, this PR fix the count based on how many RPC method are inside the batch request

// check batch limit
const errs = wsBatchLimit(objs);
if (errs != null) {
return cb(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the args handled by Node.js net.js function normalizeArgs?

code ref: net.js?L252:10
https://sourcegraph.com/github.com/nodejs/node/-/blob/lib/net.js?L252:10&popover=pinned

@RetricSu RetricSu merged commit ea211d7 into 1.9-rc Jan 9, 2023
@RetricSu RetricSu deleted the batch-limit branch January 9, 2023 05:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants