Participants are joining event, MartenitsaEvent::participants arrays grows in size. Participants array can grow so big that it will not be possible to stop event by calling MartenitsaEvent::stopEvent function.
If MartenitsaEvent::participants grows big, it will never be possible to stop the event. It means that protocol is basically unusable after that, it will not be able to correctly start another event because MartenitsaEvent::stopEvent function has important logic to clear producers mapping.
Place the following test into MartenitsaEvent.t.sol. Import console from forge-std/Test.sol.
As MartenitsaEvent::participants array grows, it will cost substantially more gas to stop the event.
Test output:
Manual review
Change logic of MartenitsaEvent::stopEvent function so there is no looping through dynamic storage array.
One potential suggestion is to have mapping(uint256 eventId => mapping(address => bool)) isProducer so there is no need to clear whole mapping for each event.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.