Skip to content

Conversation

@Forostovec
Copy link
Contributor

The depth throttling in trie/sync’s Missing() used a strict-greater-than check (>) against maxFetchesPerDepth, which allowed scheduling one extra request per depth before breaking out of the loop. This behavior contradicts the comment that describes the value as a maximum and provides no tangible benefit, since the loop immediately breaks on the next iteration while the counter is already beyond the intended cap. Changing the comparison to greater-or-equal (>=) enforces the documented maximum precisely and prevents depth counters from exceeding the cap by one. This change aligns the implementation with the intended semantics without affecting completion logic, as decrements still occur on commit via commitNodeRequest and commitCodeRequest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants