Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Consensus] fix GC missing blocks reported via the try_fetch_blocks m…
…ethod (#20992) ## Description Blocks reported as missing via the `block_manager.try_fetch_blocks` method because they are not added in the `missing_ancestors` map they are not picked up for cleaning via the Garbage Collection mechanism. Those blocks are then picked up by the periodic synchronizer to fetch - which is unnecessary - and even worse, since the majority of the network might have already rejected them there aren't many many authorities around which actually have the blocks available to serve. That leads to the periodic synchronizer constantly working and not able to fetch any of those blocks. This PR is fixing this behaviour by adding the blocks in the `missing_ancestors` map so they are properly picked up by GC for clean up. ## Test plan Wrote a test which confirmed the existing behaviour (blocks are stuck in the block manager and not cleaned up). Then when applied the fix test turned into Green. CI/PT --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] gRPC: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
- Loading branch information