Skip to content

Inconsistent Mirror Node responses for contracts/call when value field is omitted in HTS transfer estimation #4459

@quiet-node

Description

@quiet-node

Description

This ticket tracks an inconsistency observed when calling eth_estimateGas through the Relay (https://testnet.hashio.io/api). The behavior changes depending on whether the value field is included in the request payload. This discrepancy originates from different responses returned by the Mirror Node, but results in inconsistent handling within the Relay.


Steps to Reproduce

Request without value:

curl https://testnet.hashio.io/api/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "method": "eth_estimateGas",
    "params": [{
      "from": "0x743b4e1010671579CEC58f0932Bdac1f94F99847",
      "to": "0x0000000000000000000000000000000000644921",
      "data": "0xa9059cbb000000000000000000000000b99bdacec66c5cea3448ac561dfb498a26ffac150000000000000000000000000000000000000000000000000000000000000001"
    }],
    "id": 1,
    "jsonrpc": "2.0"
  }'

Behavior:

  • The Relay receives a BAD_REQUEST from the Mirror Node with message CONTRACT_REVERT_EXECUTED.
  • The Relay interprets this as a revert and returns a JSON-RPC error with code 3.

Request with value:

curl https://testnet.hashio.io/api/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "method": "eth_estimateGas",
    "params": [{
      "from": "0x743b4e1010671579CEC58f0932Bdac1f94F99847",
      "to": "0x0000000000000000000000000000000000644921",
      "data": "0xa9059cbb000000000000000000000000b99bdacec66c5cea3448ac561dfb498a26ffac150000000000000000000000000000000000000000000000000000000000000001",
      "value": "0x1"
    }],
    "id": 1,
    "jsonrpc": "2.0"
  }'

Behavior:

  • The Mirror Node returns a different error message: LOCAL_CALL_MODIFICATION_EXCEPTION.
  • The Relay falls back to predefinedGasForTransaction() and returns an estimated gas value instead of an error.

Impact

The Relay produces inconsistent results for otherwise equivalent eth_estimateGas requests depending on the presence of the value field. Although this behavior stems from Mirror Node differences, it affects downstream clients relying on consistent gas estimation results.


Tracking Actions

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions