Open sherlock-admin3 opened 4 months ago
1 comment(s) were left on this issue during the judging contest.
0xmystery commented:
SafeApplyFuncOnAllActiveEpochEndingTopics
will incorrectly loop additional topics when max topic page is already reached
The protocol team fixed this issue in the following PRs/commits: https://github.com/allora-network/allora-chain/pull/542
imsrybr0
Medium
SafeApplyFuncOnAllActiveEpochEndingTopics processes two more pages than the desired max topic page
Summary
SafeApplyFuncOnAllActiveEpochEndingTopics processes more pages than the desired max topic page.
Vulnerability Detail
The current loop iteration is strictly checked against the given max topic page after the processing is done.
This means that two more pages will be processed.
For example, if the max topic pages is 100 :
PoC
Impact
Processing topic rewards for more active topics than intended.
Code Snippet
SafeApplyFuncOnAllActiveEpochEndingTopics
Tool used
Manual Review
Recommendation
Check if the maxTopicPages is reached at the beginning of the loop