kaspanet / rusty-kaspa

Kaspa full-node and related libraries in the Rust programming language. This is a stable version at the initial rollout phases.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit the number of blocks returned by GetVirtualChainFromBlock

coderofstuff opened this issue · comments

Currently, GetVirtualChainFromBlock will try to fetch all the blocks that fit the criteria of the RPC call. In 1BPS this is fine, but in 10BPS the data returned can be significantly larger.

To allow for better processing on higher BPS, limit the number of blocks returned by GetVirtualChainFromBlock either by allowing to pass a limit value or by setting a hard limit of blocks per call.

This looks to be getting implemented by @D-Stacks in https://github.com/D-Stacks/rusty-kaspa/blob/8397edb4ae138d34c70876382d12c761cc10e1ef/components/consensusmanager/src/session.rs#L253 which is in PR #401

should i add this directly into this pr? i changed internal consensus api to be able to take a limit, but it isn't implemented on RPC calls directly in #401 , although it would just need a few lines of code added to implement this.