Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(p2p): cache responses to serve without roundtrip to db (#2352)
## Linked Issues/PRs <!-- List of related issues/PRs --> - the intermittent outages on testnet ## Description <!-- List of detailed changes --> ~When we request transactions for a given block range, we shouldn't only keep using the same peer causing pressure on it. we should pick a random one with the same height and try to get the transactions from that instead.~ This PR caches p2p responses (ttl 10 seconds by default) and serves requests from cache falling back to db for others. ## 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 - [ ] I have created follow-up issues caused by this PR and linked them here ### After merging, notify other teams [Add or remove entries as needed] - [ ] [Rust SDK](https://github.com/FuelLabs/fuels-rs/) - [ ] [Sway compiler](https://github.com/FuelLabs/sway/) - [ ] [Platform documentation](https://github.com/FuelLabs/devrel-requests/issues/new?assignees=&labels=new+request&projects=&template=NEW-REQUEST.yml&title=%5BRequest%5D%3A+) (for out-of-organization contributors, the person merging the PR will do this) - [ ] Someone else? --------- Co-authored-by: Mårten Blankfors <[email protected]> Co-authored-by: Rafał Chabowski <[email protected]> Co-authored-by: green <[email protected]>
- Loading branch information