Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
2 tasks done
maestroi opened this issue Feb 23, 2024 · 5 comments
Open
2 tasks done

Comments

@maestroi
Copy link
Contributor

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

@ii-cruz
Copy link

ii-cruz commented Apr 19, 2024

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

@maestroi
Copy link
Contributor Author

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

@sisou
Copy link
Member

sisou commented Apr 19, 2024

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.

@maestroi
Copy link
Contributor Author

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

@ii-cruz
Copy link

ii-cruz commented Apr 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants