hedera-json-rpc-relay icon indicating copy to clipboard operation
hedera-json-rpc-relay copied to clipboard

Redesign of the HBar rate limiter

Open ebadiere opened this issue 1 year ago • 0 comments

Problem

The current HBar rate limiter is designed to limit the operator HBar spending over a duration such as a minute, but the relay may get batches of many FileAppend transactions that disproportionally spend the relay's operator balance. Reducing the remaining balance in the HBar rate limiter can stop the many incoming FileAppend transactions but can also stop other users from simply deploying transactions.

Solution

Redesign the HBar rate limiter

Consider:

  • Rate limiting using the operator's quota for the day. Query the mirror node for updated operator balance at regular intervals.
  • Limit the FileAppend per user of IP
  • Define requirements

Alternatives

No response

### Tasks
- [x] Implement real-time tracking of HBar spending across different operations and transaction types.
- [ ] Support flexible alerting mechanisms for spending thresholds. (TODO)
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2863
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2850
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2849
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2896
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2933
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2940
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2955
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2968
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/2970
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/3018
- [ ] https://github.com/hashgraph/hedera-json-rpc-relay/issues/3025

ebadiere avatar Jul 23 '24 14:07 ebadiere