Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(consensus): separate sending block parts from "pick part" lo…
…gic (cometbft#2663) This was done by @ebuchman as part of a refactoring spree :-) The goal of this is to improve testability of `gossipDataRoutine` by separating out the logic for picking which block part to send. We introduced a new pure function, `pickPartToSend`, which returns a block part, and then call the new `SendPartSetHasPart` method to send it and update the peer state. This greatly simplifies the loop in `gossipDataRoutine`, and allows the `pickPartToSend` function to be independently tested. Note for reviewers: * This PR is built on top of cometbft#2659 * This is pure refactoring, no logic change was intended. * This PR can be reviewed commit by commit --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments - [x] Title follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec --------- Co-authored-by: Sergio Mena <sergio@informal.systems> Co-authored-by: Ethan Buchman <ethan@coinculture.info>
- Loading branch information