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

Add 'multinvoke*historic' (allow multiple blocks per historic call) #3814

Closed
lock9 opened this issue Feb 14, 2025 · 5 comments
Closed

Add 'multinvoke*historic' (allow multiple blocks per historic call) #3814

lock9 opened this issue Feb 14, 2025 · 5 comments
Labels
feature Completely new functionality I2 Regular impact

Comments

@lock9
Copy link
Contributor

lock9 commented Feb 14, 2025

Is your feature request related to a problem? Please describe.

The historic endpoints are very useful. The only issue is that it can only accept a single block per request. It would be useful to allow multiple blocks per requests.

Describe the solution you'd like

Create new endpoints that work like the existing historical ones that accept multiple state roots.

Describe alternatives you've considered

We are working on an indexer to avoid this, but this solution will take some time to be ready.

Additional context

While the historic endpoints already solve many problems, we need to 'flood' the server to get historical data for a week or month.

Don't forget to add labels!

  • rpc
  • feature
@lock9 lock9 added feature Completely new functionality I2 Regular impact labels Feb 14, 2025
@roman-khimov
Copy link
Member

I don't think we will ever provide this. Historic calls are not exactly cheap and this obviously amplifies the load on the server. In most cases it'd be insecure. If cases where risks are acceptable I doubt it would give you a lot of benefit performance-wise. Consider also cases of iterators returned, they all require additional resources server-side.

@lock9
Copy link
Contributor Author

lock9 commented Feb 14, 2025

In most cases it'd be insecure.

What do you mean? Is it safe if I use it against a local rpc instance? (which we control)

Consider also cases of iterators returned, they all require additional resources server-side.

Could you detail a bit more what kind of resources? Would it be possible to compute results locally? (considering you have a working VM in the browser).

We don't use iterators and we don't miss it. It's possible to circumvent it. Maybe we could do the same here.

@roman-khimov
Copy link
Member

Is it safe if I use it against a local rpc instance? (which we control)

Sure, your node --- your rules.

Could you detail a bit more what kind of resources?

Iterator must be backed by server-side session operating over the DB (neo-project/neo#3429 can help somewhat, but not in all cases).

I'd rather just shoot multiple requests at the NeoGo node (tune RPC limits appropriately if needed), there is no need to extend the API for it.

@lock9
Copy link
Contributor Author

lock9 commented Feb 14, 2025

The problem is that some providers, like AWS, charge per request. It costs 20 or even 50 times more to use multiple requests. Anyway, I'll figure something out. Thanks

@lock9 lock9 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2025
@roman-khimov
Copy link
Member

You can use batched requests then, that's also a possibility. Little-known, but available and supported by NeoGo.

https://www.jsonrpc.org/specification#batch

But the limit for the number of requests in a batch is currently hardcoded at 100. This we can make configurable if you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality I2 Regular impact
Projects
None yet
Development

No branches or pull requests

2 participants