echidna icon indicating copy to clipboard operation
echidna copied to clipboard

Shrink on one worker

Open arcz opened this issue 1 year ago • 1 comments
trafficstars

There was a high contention while shrinking with multiple workers at the same time. This locks shrinking to the same worker which solved the test. Fixes https://github.com/crytic/echidna/issues/1105.

Changes and implications:

  1. Only the worker which solved a test will shrink the test. Worker number is displayed in the UI while shrinking.
  2. If there is shrinking work, do it until the shrink limit and then go back to fuzzing. Fuzzing will be put on pause when all workers are shrinking.
  3. Test limit is unevenly distributed. When worker shrinks it doesn't work on its portion of test limit. This will be fixed in another PR.
  4. Refactored selectMainContract, mkTests and mkSignatureMap out of loadSpecified. This allows for more granular control to easier construct Env. Moved world to the Env and tests can be created before Env.
  5. Merged Campaign.updateTest and Test.updateOpenTest into Campaign.updateOpenTest.

TODO: Look into reintroducing multicore shrinking with better synchronization (https://github.com/crytic/echidna/issues/1249).

arcz avatar Jun 27 '24 12:06 arcz