Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep data in fails cases in sync service (#2361)
## Linked Issues/PRs Closes #2357 ## Description This pull request introduces a caching mechanism to the sync service to avoid redundant data fetching from the network. The most important changes include adding a cache module, modifying the `Import` struct to include a cache, and updating related methods to utilize this cache. ### Caching Mechanism: * [`crates/services/sync/src/import.rs`](diffhunk://#diff-08dae2906fc83b4bb6a03ea474b9e751ef7e290343f66859a669a101c0844a9fR5-R8): Added a new `cache` module and integrated it into the `Import` struct. Updated methods to use the cache for fetching and storing headers and blocks. * Cache mechanism allow use to retrieve a stream of batches of either cached headers, cached full blocks, or range to fetch data. ### Test Updates: * Update the P2P port in mocks to use async to simulate more complex tests needed for this feature. This PR contains 50% of changes in the tests and addition of tests in the cache. ## Checklist - [x] Breaking changes are clearly marked as such in the PR description and changelog - [x] New behavior is reflected in tests - [x] [The specification](https://github.com/FuelLabs/fuel-specs/) matches the implemented behavior (link update PR if changes are needed) ### Before requesting review - [x] I have reviewed the code myself - [x] I have created follow-up issues caused by this PR and linked them here --------- Co-authored-by: Rafał Chabowski <88321181+rafal-ch@users.noreply.github.com> Co-authored-by: green <xgreenx9999@gmail.com>
- Loading branch information