Fix O(n²) find_head and stack overflow in filter_block_tree (#9090)

Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>

Co-Authored-By: Michael Sproul <michaelsproul@users.noreply.github.com>
This commit is contained in:
Lion - dapplion
2026-06-05 03:24:49 +02:00
committed by GitHub
parent da42d37456
commit 494b00a349
6 changed files with 272 additions and 72 deletions

View File

@@ -514,6 +514,7 @@ impl ProtoArrayForkChoice {
prune_threshold: DEFAULT_PRUNE_THRESHOLD,
nodes: Vec::with_capacity(1),
indices: HashMap::with_capacity(1),
children: Vec::with_capacity(1),
};
let block = Block {