hashgraph / hedera-json-rpc-relay

Implementation of Ethereum JSON-RPC APIs for Hedera
Apache License 2.0
65 stars 70 forks source link

Inconsistent transaction execution and rate limiting issues across different JSON-RPC relays #2759

Open mshakeg opened 3 months ago

mshakeg commented 3 months ago

Description

When interacting with the Hedera network using different JSON-RPC relays, I've encountered two significant issues:

  1. Inconsistent transaction execution: Identical transactions sent through different relays yield different results. One transaction fails while the other succeeds, with the only difference being the JSON-RPC relay used.

Example:

  1. Rate limiting: The official hashio relay has very tight rate limits, frequently resulting in a "HBAR Rate limited exceeded" error. This forces users to seek alternative relays, which may lead to the inconsistent behavior mentioned above.

Expected behavior:

  1. Transactions should execute consistently regardless of the JSON-RPC relay used.
  2. Rate limits should be more accommodating to allow for reasonable usage without frequent errors.

Steps to reproduce

  1. Inconsistent transaction execution: a. Attempt to execute a Gnosis Safe transaction(or perhaps any tx) using the thirdweb relay (https://295.rpc.thirdweb.com). b. Observe that the transaction fails. c. Execute the same transaction using the hashio relay (https://mainnet.hashio.io/api). d. Observe that the transaction succeeds.

  2. Rate limiting issues: a. Connect to the hashio relay (https://mainnet.hashio.io/api). b. Execute smart contract function calls at a rate of approximately 1 per minute for 5-10 minutes. c. Observe the "HBAR Rate limited exceeded" error occurring frequently.

Additional notes:

Additional context

No response

Hedera network

mainnet

Version

latest on mainnet as of writing

Operating system

None

mshakeg commented 3 months ago

Same issue as thirdweb using the validationcloud relay:

https://hashscan.io/mainnet/transaction/1722019233.447989003

mshakeg commented 2 months ago

Hey @Ivo-Yankov @natanasow @ebadiere would appreciate if this issue was taken more seriously.

I frequently run into the HBAR Rate limit exceeded error when simply making a few eth_calls(<10/min) on the hashio mainnet relay, and it makes for a terrible devX. Not sure why eth_calls would ever have the HBAR Rate limit exceeded error, as they don't cost HBAR.

fessmm commented 2 months ago

@Nana-EC ^

mshakeg commented 2 months ago

I'm also unable to deploy a contract via the hashio mainnet relay:

[Request ID: cbf5eed7-b21c-48c4-8d77-4814930665b9] The HBAR rate limit was preemptively exceeded due to an excessively large callData size.

ebadiere commented 2 months ago

@mshakeg This issue is being taken seriously. We are currently in the process of refactoring the HBar Rate Limiter to support many configuration points. At this time Hashio is not meant to be used for production applications. It's there to help a user get started, with the intent that the user migrates to a third party provider.

Issue #2739 is the Epic that is tracking this effort.

mshakeg commented 2 months ago

@ebadiere thanks for the update. I tried a few other providers when I initially created this issue, thirdweb had issues then as well, however, their relay seems to be performing much better since though not perfectly, it frequently returns an error response, despite the tx being relayed to the core validator/s.