Skip to content

Commit

Permalink
Multicore (#963)
Browse files Browse the repository at this point in the history
* Multicore

* Try different approach for stopping workers

* Fix windows warning

* Cleanup

* Distribute corpus replay across workers

* Change jobs to workers in config and CLI

* Fix corpus chunking

* Use better chunksOf

* Fix JSON output

* Fix rebasing mistake

* Fix workers not stopping while fetching RPC

* Fix optimization tests shrinking

* Dont set Solved for optimization tests
  • Loading branch information
arcz committed May 5, 2023
1 parent 134a4f2 commit 87449e9
Show file tree
Hide file tree
Showing 24 changed files with 1,021 additions and 658 deletions.
9 changes: 5 additions & 4 deletions lib/Echidna.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Echidna where

import Control.Monad.Catch (MonadThrow(..))
import Data.IORef (writeIORef)
import Data.List (find)
import Data.List.NonEmpty (NonEmpty)
import Data.List.NonEmpty qualified as NE
Expand All @@ -18,12 +19,11 @@ import Echidna.Output.Corpus
import Echidna.Processor
import Echidna.Solidity
import Echidna.Test (createTests)
import Echidna.Types.Campaign hiding (corpus)
import Echidna.Types.Campaign
import Echidna.Types.Config
import Echidna.Types.Random
import Echidna.Types.Signature
import Echidna.Types.Solidity
import Echidna.Types.Test
import Echidna.Types.Tx
import Echidna.Types.World

Expand All @@ -44,7 +44,7 @@ prepareContract
-> NonEmpty FilePath
-> Maybe ContractName
-> Seed
-> IO (VM, World, [EchidnaTest], GenDict)
-> IO (VM, World, GenDict)
prepareContract env contracts solFiles specifiedContract seed = do
let solConf = env.cfg.solConf

Expand Down Expand Up @@ -82,7 +82,8 @@ prepareContract env contracts solFiles specifiedContract seed = do
seed
(returnTypes contracts)

pure (vm, world, echidnaTests, dict)
writeIORef env.testsRef echidnaTests
pure (vm, world, dict)

loadInitialCorpus :: Env -> World -> IO [[Tx]]
loadInitialCorpus env world = do
Expand Down
Loading

0 comments on commit 87449e9

Please sign in to comment.