kaspanet / rusty-kaspa

Kaspa full-node and related libraries in the Rust programming language. This is a Beta version at the final testing phases.
ISC License
350 stars 105 forks source link

Limit the number of blocks returned by GetVirtualChainFromBlock #440

Open coderofstuff opened 1 month ago

coderofstuff commented 1 month ago

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.

coderofstuff commented 1 month ago

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

D-Stacks commented 1 month ago

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.