-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove unbounded vec allocations from base node grpc/p2p messagi…
…ng (#3467) Description --- - replaces unbounded height lists with bound height ranges in internal base node service interfaces and p2p messaging - removes unused and deprecated base node p2p messaging requests/responses - load chain headers when requesting headers, this simplifies and reduces the database load when calling grpc get_blocks - use iterator with almost no footprint for paging in grpc calls - implement `DoubleSidedIterator` for `NonOverlappingIntegerPairIter` - add overflow protection to `NonOverlappingIntegerPairIter` and additional tests This PR does not contain any breaking changes, as no nodes using the base node p2p messaging interface except for block propagation (which is unchanged). GRPC protobuf contract is preserved. **New dependency** `either = "1.6.1"` added to `tari_base_node` crate and used for its `Either` iterator impl Motivation and Context --- - removing unused "outbound comms interface" request/responses reduces attack surface (TODO: remove this interface entirely - specifically the coupling for internal service requests and external p2p comms is troublesome, but mostly removed in the PR, but removing it entirely will make making changes to the base node service much easier) - remote peers could request any number of heights allowing an external party to allocate memory without bounds Closes #3310 How Has This Been Tested? --- Existing GRPC tests Manually tested block explorer api connected to local base node Additional unit tests
- Loading branch information
Showing
25 changed files
with
429 additions
and
974 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.