core-rs-albatross icon indicating copy to clipboard operation
core-rs-albatross copied to clipboard

[RPC] - U16 Limit for "getTransactionHashesByAddress" prevents all tx to be fetched

Open maestroi opened this issue 1 year ago • 6 comments

New issue checklist

General information

  • Library version(s): 0.20.0 >
  • Browser version(s): -
  • Devices/Simulators/Machine affected: -
  • Reproducible in the testnet? (Yes/No): Yes
  • Related issues: -

Bug report

Expected behavior

{ "jsonrpc": "2.0", "id": 1, "method": "getTransactionHashesByAddress", "params": [ "NQ65 DHN8 4BSR 5YSX FC3V BB5J GKM2 GB2L H17C", 90000 ] }

To fetch all 90k transactions

Actual behavior

{ "jsonrpc": "2.0", "error": { "code": -32602, "message": "Invalid params", "data": "Expected an object for the request parameters." }, "id": 1 }

if the int is higher than 65535 there is invalid parameter error

Steps to reproduce

--- CORRECT REQUEST { "jsonrpc": "2.0", "id": 1, "method": "getTransactionHashesByAddress", "params": [ "NQ65 DHN8 4BSR 5YSX FC3V BB5J GKM2 GB2L H17C", 65535 ] }

--- INCORRECT { "jsonrpc": "2.0", "id": 1, "method": "getTransactionHashesByAddress", "params": [ "NQ65 DHN8 4BSR 5YSX FC3V BB5J GKM2 GB2L H17C", 65536 ] }

Crash log? Screenshots? Videos? Sample project?

NO

Question or Feature Request

I only checked this specific RPC call but there could be more

maestroi avatar Feb 23 '24 08:02 maestroi

iirc this is the desired behavior since these requests are expensive for the node.

ii-cruz avatar Apr 19 '24 14:04 ii-cruz

@ii-cruz that sounds nice but how do we know about old transactions by account

maestroi avatar Apr 19 '24 18:04 maestroi

My suggestion was to change this in your own fork, but I see how that's inconvenient, as it preclude you from just using the official docker container or build.

How about adding a config option to the RPC section that enables more advanced features like this, with the appropriate warnings? I don't know if a config switch can change an argument, or if it would just enable and disable between two almost identical methods.

sisou avatar Apr 19 '24 19:04 sisou

An config option would be nice, or a u32 container build

maestroi avatar Apr 19 '24 19:04 maestroi

We could bundle all of the more expensive rpc options into one config option for example. There are more instances of this iirc.

This will likely be a very low priority to look at since we are still investigating what to do with these indexes that are slowing down the history sync #1998.

ii-cruz avatar Apr 29 '24 18:04 ii-cruz

Related to #2733 and #2697

paberr avatar Jul 12 '24 15:07 paberr