-
Notifications
You must be signed in to change notification settings - Fork 144
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
virtual chain from block
batching.
#454
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes
- Based on discussions, the intent is that this RPC API should work with a default behavior even if
startHash
is not specified. In such a case, startHash will become the pruning point automatically.
Changes
- Add this RPC call in
cli/src/modules/rpc.rs
- On
rpc/core/wasm/message.rs
:- update the IGetVirtualChanFromBlockRequest interface so that startHash is nullable.
- Update the try_from accordingly such that if
startHash
is not set, it defaults to zero hash
let mut removed = Vec::new(); | ||
let mut common_ancestor = from; | ||
for current in self.reachability_service.default_backward_chain_iterator(from) { | ||
for current in self.reachability_service.default_backward_chain_iterator(from).take(max_traversal_allowed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This iteration would start from block at from + max_traversal_allowed
and go back all the way to from
correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well technically it is more like starting at from
, and going back at most max_traversal_allows
(the break condition is in the loop).
…chain ancestor of high.
…kaspa into vspcc_batch_call
This PR exposes virtual chain from block and acceptance data batching possibilities in consensus; via a
limit
parameter. new consensus api is exposed to the corresponding vspc rpc call, which will implictly batch bymergeset_size_limit * 10
amount of chain blocks, ifinclude_trainsactions = false
, elsemergeset_size_limit * 10
amount of merged blocks (via further processing).It also exposes get_virtual_chain_from_block in cli.
Note: this change needs to be clearly communicated and documented to external kaspa integrators, who are using this call, as changes are implicit, and not circumventable, any integrator that assumes a full virtual chain to the current virtual parent, and relies on this behavior, for whatever reason, may experience issues with their integration. Although old versions will still have this behavior.
Resolves #440
(also adds some log level changes for mempool, and a version bump to 0.15.2 on the side)