From 08041e4b6e327eb258d34124dfd8c83c7ae1ca4e Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Thu, 11 Jul 2024 15:28:59 +0200 Subject: [PATCH 01/11] Initial support for tstore/tload (#1286) * switch to tstore branch on hevm fork. all we should need now is a call to clearTStorages * call clearTStorages after each transaction * test case * bump hevm * bump hevm again --------- Co-authored-by: Sam Alws --- flake.nix | 4 ++-- lib/Echidna/Exec.hs | 3 ++- stack.yaml | 2 +- tstore_test.sol | 24 ++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 tstore_test.sol diff --git a/flake.nix b/flake.nix index a9399895f..b774761bb 100644 --- a/flake.nix +++ b/flake.nix @@ -51,8 +51,8 @@ pkgs.haskellPackages.callCabal2nix "hevm" (pkgs.fetchFromGitHub { owner = "trail-of-forks"; repo = "hevm"; - rev = "2aa7b3e5fea0e0657fe44549ccefbb18f61eb024"; - sha256 = "sha256-/9NMvSOzP0agJ1qEFDN/OQvV0DXRTN3AbntTAzPXbCw="; + rev = "7d4344c5e71d14466e86331af064bab61d06bdad"; + sha256 = "sha256-kts6mdwx5KUrVdNztzewWgNM9xGViAhFIZPnWOUllOU="; }) { secp256k1 = pkgs.secp256k1; }); # FIXME: figure out solc situation, it conflicts with the one from diff --git a/lib/Echidna/Exec.hs b/lib/Echidna/Exec.hs index e6711fe13..99f3aa3ce 100644 --- a/lib/Echidna/Exec.hs +++ b/lib/Echidna/Exec.hs @@ -22,7 +22,7 @@ import Data.Vector qualified as V import Data.Vector.Unboxed.Mutable qualified as VMut import System.Process (readProcessWithExitCode) -import EVM (bytecode, replaceCodeOfSelf, loadContract, exec1, vmOpIx) +import EVM (bytecode, replaceCodeOfSelf, loadContract, exec1, vmOpIx, clearTStorages) import EVM.ABI import EVM.Dapp (DappInfo) import EVM.Exec (exec, vmForEthrunCreation) @@ -98,6 +98,7 @@ execTxWith executeTx tx = do vmResult <- runFully gasLeftAfterTx <- gets (.state.gas) handleErrorsAndConstruction vmResult vmBeforeTx + fromEVM clearTStorages pure (vmResult, gasLeftBeforeTx - gasLeftAfterTx) where runFully = do diff --git a/stack.yaml b/stack.yaml index d09734d4f..d63fc4282 100644 --- a/stack.yaml +++ b/stack.yaml @@ -5,7 +5,7 @@ packages: extra-deps: - git: https://github.com/trail-of-forks/hevm.git - commit: 2aa7b3e5fea0e0657fe44549ccefbb18f61eb024 + commit: 7d4344c5e71d14466e86331af064bab61d06bdad - restless-git-0.7@sha256:346a5775a586f07ecb291036a8d3016c3484ccdc188b574bcdec0a82c12db293,968 - s-cargot-0.1.4.0@sha256:61ea1833fbb4c80d93577144870e449d2007d311c34d74252850bb48aa8c31fb,3525 diff --git a/tstore_test.sol b/tstore_test.sol new file mode 100644 index 000000000..eea83c138 --- /dev/null +++ b/tstore_test.sol @@ -0,0 +1,24 @@ +pragma solidity >=0.8.25; + +contract Test { + uint256 x; + uint256 y; + function A() public { + assembly { + if tload(0) { revert(0,0) } + tstore(0, 1) + if iszero(tload(0)) { revert(0,0) } + } + x = 5; + } + function B() public { + if (x != 5) revert(); + assembly { + if tload(0) { revert(0,0) } + } + y = 10; + } + function echidna_foo() public view returns (bool) { + return y != 10; + } +} From 7bbfd68846d212ecac4f93ddbe1a6492f59aaa1d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:16:25 +0200 Subject: [PATCH 02/11] Bump sigstore/gh-action-sigstore-python from 2.1.1 to 3.0.0 (#1289) Bumps [sigstore/gh-action-sigstore-python](https://github.com/sigstore/gh-action-sigstore-python) from 2.1.1 to 3.0.0. - [Release notes](https://github.com/sigstore/gh-action-sigstore-python/releases) - [Changelog](https://github.com/sigstore/gh-action-sigstore-python/blob/main/CHANGELOG.md) - [Commits](https://github.com/sigstore/gh-action-sigstore-python/compare/v2.1.1...v3.0.0) --- updated-dependencies: - dependency-name: sigstore/gh-action-sigstore-python dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d38832264..a25b969a8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,7 +96,7 @@ jobs: merge-multiple: true - name: Sign binaries - uses: sigstore/gh-action-sigstore-python@v2.1.1 + uses: sigstore/gh-action-sigstore-python@v3.0.0 with: inputs: ./echidna-*.tar.gz From 6220064678611521595d70f89c0a1be363f861c7 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Tue, 16 Jul 2024 10:20:31 +0200 Subject: [PATCH 03/11] Fix typos (#1287) * fix typo * fix typo * fix typo * fix typo --- CONTRIBUTING.md | 2 +- README.md | 2 +- tests/solidity/addressarrayutils/AddressArrayUtils.sol | 2 +- .../addressarrayutils/AddressArrayUtils_withHasDuplicateBug.sol | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fa2fdaf75..4d3849b2a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,7 +5,7 @@ appreciate all contributions, including bug reports, feature suggestions, tutorials/blog posts, and code improvements. If you're unsure where to start, we recommend to join our [chat room](https://slack.empirehacking.nyc/) -(in the #ethereum channel) to discuss new ideas to improve this tool. You can also take a look to the [`help wanted`](https://github.com/crytic/echidna/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) +(in the #ethereum channel) to discuss new ideas to improve this tool. You can also take a look at the [`help wanted`](https://github.com/crytic/echidna/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) issue labels. ## Bug reports and feature suggestions diff --git a/README.md b/README.md index 2148c5543..38e6a575c 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ Common causes for performance issues that we observed: - Lazy data constructors that accumulate thunks - Inefficient data structures used in hot paths -Checking for these is a good place to start. If you suspect some comuptation is too lazy and +Checking for these is a good place to start. If you suspect some computation is too lazy and leaks memory, you can use `force` from `Control.DeepSeq` to make sure it gets evaluated. ## Limitations and known issues diff --git a/tests/solidity/addressarrayutils/AddressArrayUtils.sol b/tests/solidity/addressarrayutils/AddressArrayUtils.sol index 64d9f2c88..4c151e499 100644 --- a/tests/solidity/addressarrayutils/AddressArrayUtils.sol +++ b/tests/solidity/addressarrayutils/AddressArrayUtils.sol @@ -314,7 +314,7 @@ library AddressArrayUtils { * Returns whether the two arrays are equal. * @param A The first array * @param B The second array - * @return True is the arrays are equal, false if not. + * @return True if the arrays are equal, false if not. */ function isEqual(address[] memory A, address[] memory B) internal pure returns (bool) { if (A.length != B.length) { diff --git a/tests/solidity/addressarrayutils/AddressArrayUtils_withHasDuplicateBug.sol b/tests/solidity/addressarrayutils/AddressArrayUtils_withHasDuplicateBug.sol index 1095cbf65..2375c9e87 100644 --- a/tests/solidity/addressarrayutils/AddressArrayUtils_withHasDuplicateBug.sol +++ b/tests/solidity/addressarrayutils/AddressArrayUtils_withHasDuplicateBug.sol @@ -313,7 +313,7 @@ library AddressArrayUtils { * Returns whether the two arrays are equal. * @param A The first array * @param B The second array - * @return True is the arrays are equal, false if not. + * @return True if the arrays are equal, false if not. */ function isEqual(address[] memory A, address[] memory B) internal pure returns (bool) { if (A.length != B.length) { From 7fe4d401e45a54516745e7f7f932986497673eb9 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Tue, 16 Jul 2024 11:23:07 +0300 Subject: [PATCH 04/11] Docs improvement (#1278) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix README.md * fix Array.hs * fix Corpus.hs * fix Coverage.hs * fix Solidity.hs * fix Tx.hs * fix Report.hs * fix ABI.hs * fix Campaign.hs * fix Exec.hs * fix Onchain.hs --------- Co-authored-by: Emilio López <2642849+elopez@users.noreply.github.com> --- .github/container-linux-static/README.md | 2 +- lib/Echidna/ABI.hs | 2 +- lib/Echidna/Campaign.hs | 2 +- lib/Echidna/Exec.hs | 2 +- lib/Echidna/Mutator/Array.hs | 2 +- lib/Echidna/Onchain.hs | 2 +- lib/Echidna/Output/Corpus.hs | 2 +- lib/Echidna/Types/Coverage.hs | 2 +- lib/Echidna/Types/Solidity.hs | 2 +- lib/Echidna/Types/Tx.hs | 2 +- lib/Echidna/UI/Report.hs | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/container-linux-static/README.md b/.github/container-linux-static/README.md index 1453628f8..011d22349 100644 --- a/.github/container-linux-static/README.md +++ b/.github/container-linux-static/README.md @@ -4,5 +4,5 @@ This container is used as part of `.github/workflows/ci.yml` to produce statically-linked amd64 linux builds of Echidna. It is based on the following container produced by FP Complete and maintained in the [`fpco/alpine-haskell-stack`](https://github.com/fpco/alpine-haskell-stack/tree/ghc927) -repository, and contains a few extra dependencies and configuration to make it +repository, and contains a few extra dependencies and configurations to make it suitable for the GitHub Actions environment. diff --git a/lib/Echidna/ABI.hs b/lib/Echidna/ABI.hs index d3616bdc7..e5269c967 100644 --- a/lib/Echidna/ABI.hs +++ b/lib/Echidna/ABI.hs @@ -211,7 +211,7 @@ addChars c b = foldM withR b . enumFromTo 0 =<< rand where addNulls :: MonadRandom m => ByteString -> m ByteString addNulls = addChars $ pure 0 --- | Given a \"list-y\" structure with analogues of 'take', 'drop', and 'length', +-- | Given a \"list-y\" structure with analogs of 'take', 'drop', and 'length', -- remove some elements at random. shrinkWith :: MonadRandom m diff --git a/lib/Echidna/Campaign.hs b/lib/Echidna/Campaign.hs index 8842dafb1..dad687231 100644 --- a/lib/Echidna/Campaign.hs +++ b/lib/Echidna/Campaign.hs @@ -397,7 +397,7 @@ callseq vm txSeq = do where -- Given a list of transactions and a return typing rule, checks whether we - -- know the return type for each function called. If yes, tries to parse the + -- know the return type for each function called. If yes, try to parse the -- return value as a value of that type. Returns a 'GenDict' style Map. returnValues :: [(Tx, VMResult Concrete RealWorld)] diff --git a/lib/Echidna/Exec.hs b/lib/Echidna/Exec.hs index 99f3aa3ce..fb04d3580 100644 --- a/lib/Echidna/Exec.hs +++ b/lib/Echidna/Exec.hs @@ -132,7 +132,7 @@ execTxWith executeTx tx = do fromEVM (continuation contract) liftIO $ atomicWriteIORef cacheRef $ Map.insert addr (Just contract) cache _ -> do - -- TODO: better error reporting in HEVM, when intermmittent + -- TODO: better error reporting in HEVM, when intermittent -- network error then retry liftIO $ atomicWriteIORef cacheRef $ Map.insert addr Nothing cache logMsg $ "ERROR: Failed to fetch contract: " <> show q diff --git a/lib/Echidna/Mutator/Array.hs b/lib/Echidna/Mutator/Array.hs index a756c1dda..65ac2f1f5 100644 --- a/lib/Echidna/Mutator/Array.hs +++ b/lib/Echidna/Mutator/Array.hs @@ -15,7 +15,7 @@ listMutators = fromList -- | Mutate a list-like data structure using a list of mutators mutateLL :: (LL.ListLike f i, MonadRandom m) - -- | Required size for the mutated list-like value (or Nothing if there are no constrains) + -- | Required size for the mutated list-like value (or Nothing if there are no constraints) => Maybe Int -- | Randomly generated list-like value to complement the mutated list, if it is -- shorter than the requested size diff --git a/lib/Echidna/Onchain.hs b/lib/Echidna/Onchain.hs index d26cfacd1..88e7fa07d 100644 --- a/lib/Echidna/Onchain.hs +++ b/lib/Echidna/Onchain.hs @@ -99,7 +99,7 @@ toFetchedContractData contract = } -- | Try to load the persisted RPC cache. --- TODO: we use the corpus dir for now, think where to place it +-- TODO: we use the corpus dir for now, think about where to place it loadRpcCache :: EConfig -> IO ( Map Addr (Maybe Contract) diff --git a/lib/Echidna/Output/Corpus.hs b/lib/Echidna/Output/Corpus.hs index 4151d14b3..5c2d7d659 100644 --- a/lib/Echidna/Output/Corpus.hs +++ b/lib/Echidna/Output/Corpus.hs @@ -49,7 +49,7 @@ saveCorpusEvent env (_time, campaignEvent) = do getEventInfo = \case -- TODO: We save intermediate reproducers in separate directories. - -- This is to because there can be a lot of them and we want to skip + -- This is because there can be a lot of them and we want to skip -- loading those on startup. Ideally, we should override the same file -- with a better version of a reproducer, this is smaller or more optimized. TestFalsified test -> Just ("reproducers-unshrunk", test.reproducer) diff --git a/lib/Echidna/Types/Coverage.hs b/lib/Echidna/Types/Coverage.hs index 3531a8ddf..8d1241172 100644 --- a/lib/Echidna/Types/Coverage.hs +++ b/lib/Echidna/Types/Coverage.hs @@ -31,7 +31,7 @@ type TxResults = Word64 -- | Given good point coverage, count the number of unique points but -- only considering the different instruction PCs (discarding the TxResult). --- This is useful to report a coverage measure to the user +-- This is useful for reporting a coverage measure to the user scoveragePoints :: CoverageMap -> IO Int scoveragePoints cm = do sum <$> mapM (V.foldl' countCovered 0) (Map.elems cm) diff --git a/lib/Echidna/Types/Solidity.hs b/lib/Echidna/Types/Solidity.hs index f17e81697..f96076332 100644 --- a/lib/Echidna/Types/Solidity.hs +++ b/lib/Echidna/Types/Solidity.hs @@ -50,7 +50,7 @@ instance Show SolException where ConstructorArgs s -> "Constructor arguments are required: " ++ s NoCryticCompile -> "crytic-compile not installed or not found in PATH. To install it, run:\n pip install crytic-compile" InvalidMethodFilters f -> "Applying the filter " ++ show f ++ " to the methods produces an empty list. Are you filtering the correct functions using `filterFunctions` or fuzzing the correct contract?" - SetUpCallFailed -> "Calling the setUp() function failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.)" + SetUpCallFailed -> "Calling the setUp() function failed (revert, out-of-gas, sending ether to a non-payable constructor, etc.)" DeploymentFailed a t -> "Deploying the contract " ++ show a ++ " failed (revert, out-of-gas, sending ether to an non-payable constructor, etc.):\n" ++ unpack t OutdatedSolcVersion v -> "Solc version " ++ toString v ++ " detected. Echidna doesn't support versions of solc before " ++ toString minSupportedSolcVersion ++ ". Please use a newer version." diff --git a/lib/Echidna/Types/Tx.hs b/lib/Echidna/Types/Tx.hs index 11c1372cc..ea844eec0 100644 --- a/lib/Echidna/Types/Tx.hs +++ b/lib/Echidna/Types/Tx.hs @@ -218,7 +218,7 @@ catNoCalls (tx1:tx2:xs) = _ -> tx1 : catNoCalls (tx2:xs) where nc = tx1 { delay = (fst tx1.delay + fst tx2.delay, snd tx1.delay + snd tx2.delay) } --- | Transform a VMResult into a more hash friendly sum type +-- | Transform a VMResult into a more hash-friendly sum type getResult :: VMResult Concrete s -> TxResult getResult = \case VMSuccess b | forceBuf b == encodeAbiValue (AbiBool True) -> ReturnTrue diff --git a/lib/Echidna/UI/Report.hs b/lib/Echidna/UI/Report.hs index 23ee7bb2f..580267b67 100644 --- a/lib/Echidna/UI/Report.hs +++ b/lib/Echidna/UI/Report.hs @@ -59,7 +59,7 @@ ppCampaign vm workerStates = do , seedPrinted ] --- | Given rules for pretty-printing associated address, and whether to print +-- | Given rules for pretty-printing associated addresses, and whether to print -- them, pretty-print a 'Transaction'. ppTx :: MonadReader Env m => VM Concrete RealWorld -> Bool -> Tx -> m String ppTx _ _ Tx { call = NoCall, delay } = From 3b5d6d93a501d6e9cd649c51dfdb08361be83412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <2642849+elopez@users.noreply.github.com> Date: Tue, 16 Jul 2024 14:08:19 +0200 Subject: [PATCH 05/11] Raise default number of workers (#1288) Now the default number of workers will be equal to the number of cores on the system, with a minimum of 1 and a maximum of 4. --- lib/Echidna/Types/Campaign.hs | 11 ++++++++--- tests/solidity/basic/default.yaml | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Echidna/Types/Campaign.hs b/lib/Echidna/Types/Campaign.hs index 78a885189..b54c19185 100644 --- a/lib/Echidna/Types/Campaign.hs +++ b/lib/Echidna/Types/Campaign.hs @@ -3,10 +3,10 @@ module Echidna.Types.Campaign where import Control.Concurrent (ThreadId) import Data.Aeson import Data.Map (Map) -import Data.Maybe (fromMaybe) import Data.Text (Text) import Data.Text qualified as T import Data.Word (Word8, Word16) +import GHC.Conc (numCapabilities) import Echidna.ABI (GenDict, emptyDict, encodeSig) import Echidna.Types @@ -211,9 +211,14 @@ defaultSymExecAskSMTIters :: Integer defaultSymExecAskSMTIters = 1 -- | Get number of fuzzing workers (doesn't include sym exec worker) --- Defaults to 1 if set to Nothing +-- Defaults to `N` if set to Nothing, where `N` is Haskell's -N value, +-- usually the number of cores, clamped between 1 and 4. getNFuzzWorkers :: CampaignConf -> Int -getNFuzzWorkers conf = fromIntegral (fromMaybe 1 (conf.workers)) +getNFuzzWorkers conf = maybe defaultN fromIntegral conf.workers + where + n = numCapabilities + maxN = max 1 n + defaultN = min 4 maxN -- capped at 4 by default -- | Number of workers, including SymExec worker if there is one getNWorkers :: CampaignConf -> Int diff --git a/tests/solidity/basic/default.yaml b/tests/solidity/basic/default.yaml index d9c277287..fc52ab1cc 100644 --- a/tests/solidity/basic/default.yaml +++ b/tests/solidity/basic/default.yaml @@ -89,8 +89,8 @@ rpcUrl: null rpcBlock: null # Etherscan API key etherscanApiKey: null -# number of workers -workers: 1 +# number of workers. By default (unset) its value is the clamp of the number cores between 1 and 4 +workers: null # events server port server: null # whether to add an additional symbolic execution worker From 84702aabd0c2d550079a95976a184932b0973082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <2642849+elopez@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:20:35 +0200 Subject: [PATCH 06/11] Echidna 2.2.4 (#1291) --- CHANGELOG.md | 11 +++++++++++ package.yaml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae4923ffc..eaf8d4913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +## 2.2.4 + +* Initial TLOAD/TSTORE support (#1286) +* Initial symbolic execution implementation (experimental, #1216, #1251, #1285) +* New panel toggles in the UI (#1197) +* New gas/s metric (#1279) +* Improved logging (#1202, #1271, #1273, #1274, #1283, #1258, #1269) +* Performance improvements with multiple workers (#1228) +* Shrinking improvements (#1196, #1250, #1280) +* Improved configuration options (#1200, #1227, #1251) + ## 2.2.3 * feat: add CLI commands for RPC URL and block number (#1194) diff --git a/package.yaml b/package.yaml index 191eff522..2e4cc7093 100644 --- a/package.yaml +++ b/package.yaml @@ -3,7 +3,7 @@ name: echidna author: Trail of Bits maintainer: Trail of Bits -version: 2.2.3 +version: 2.2.4 ghc-options: - -O2 From f8deef5b791f93eacf3c1689d21ed15935b983c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <2642849+elopez@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:21:32 +0200 Subject: [PATCH 07/11] Fix sigstore file attachments (#1292) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a25b969a8..29fbef5b9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -107,4 +107,4 @@ jobs: name: "Echidna ${{ needs.nixBuild.outputs.version }}" files: | ./echidna-*.tar.gz - ./echidna-*.tar.gz.sigstore + ./echidna-*.tar.gz.sigstore.json From 9893a09ae9f838c5de8d7fac71886598308a6a7a Mon Sep 17 00:00:00 2001 From: Gustavo Grieco <31542053+ggrieco-tob@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:00:35 +0200 Subject: [PATCH 08/11] IllegalOverflow should be similar to a revert instead of a VM error (#1293) --- lib/Echidna/Exec.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Echidna/Exec.hs b/lib/Echidna/Exec.hs index fb04d3580..f76691897 100644 --- a/lib/Echidna/Exec.hs +++ b/lib/Echidna/Exec.hs @@ -54,7 +54,7 @@ classifyError = \case StackLimitExceeded -> RevertE StackUnderrun -> IllegalE BadJumpDestination -> IllegalE - IllegalOverflow -> IllegalE + IllegalOverflow -> RevertE _ -> UnknownE -- | Extracts the 'Query' if there is one. From e7c17fe513ef3c89e9c24af34a7191b190ae9efd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:02:51 +0200 Subject: [PATCH 09/11] Bump DeterminateSystems/nix-installer-action from 12 to 13 (#1294) Bumps [DeterminateSystems/nix-installer-action](https://github.com/determinatesystems/nix-installer-action) from 12 to 13. - [Release notes](https://github.com/determinatesystems/nix-installer-action/releases) - [Commits](https://github.com/determinatesystems/nix-installer-action/compare/v12...v13) --- updated-dependencies: - dependency-name: DeterminateSystems/nix-installer-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 29fbef5b9..c060563b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,7 +36,7 @@ jobs: uses: actions/checkout@v4 - name: Install Nix - uses: DeterminateSystems/nix-installer-action@v12 + uses: DeterminateSystems/nix-installer-action@v13 - name: Configure Cachix uses: cachix/cachix-action@v15 From a55009409e0e312f015240f4d2f02a5f58ce3687 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:03:02 +0200 Subject: [PATCH 10/11] Bump softprops/action-gh-release from 2.0.6 to 2.0.8 (#1295) Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.0.6 to 2.0.8. - [Release notes](https://github.com/softprops/action-gh-release/releases) - [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md) - [Commits](https://github.com/softprops/action-gh-release/compare/v2.0.6...v2.0.8) --- updated-dependencies: - dependency-name: softprops/action-gh-release dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c060563b0..adf25ec35 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -101,7 +101,7 @@ jobs: inputs: ./echidna-*.tar.gz - name: Create GitHub release and upload binaries - uses: softprops/action-gh-release@v2.0.6 + uses: softprops/action-gh-release@v2.0.8 with: draft: true name: "Echidna ${{ needs.nixBuild.outputs.version }}" From 182580e6457f8571ad22f2270f1e627bbba94328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20L=C3=B3pez?= <2642849+elopez@users.noreply.github.com> Date: Thu, 25 Jul 2024 13:54:13 +0200 Subject: [PATCH 11/11] Upgrade build to GHC 9.6 (#1245) * Upgrade hevm to latest `echidna-patches` commit * Upgrade build to GHC 9.6 * Refactor terminal and signal support in preparation for Windows UI * Enable UI on all platforms * Use pkgsStatic for Linux pkgsMusl fails to build for some reason. * Remove conditional UI compilation All platforms now support the Echidna UI * Enable UI on ConHost as well See the introduction on https://hackage.haskell.org/package/ansi-terminal-1.1.1/docs/System-Console-ANSI.html * Enable `eager-blackholing` Observed a ~2% speedup on longer runs when compiling both hevm and echidna with this flag. Besides, the Haskell documentation encourages enabling it for parallel code: https://downloads.haskell.org/~ghc/9.6.5/docs/users_guide/using-concurrent.html#compile-time-options-for-smp-parallelism * Resolve hlint warnings * Update Linux Stack CI to 9.6 * Fix compilation failure after merge * Upgrade hevm to `echidna-patches-20240725` * Fix lint warnings, unused imports * flake: align nixpkgs with hevm * flake: fix libiconv for x86_64 darwin > app/utf8-troubleshoot/cbits/locale.c:10:10: error: > fatal error: 'libcharset.h' file not found > | > 10 | #include > | ^ > #include > ^~~~~~~~~~~~~~ Also link iconv dynamically on Darwin as well --- .github/container-linux-static/Dockerfile | 8 +- .../container-linux-static/stack-config.yaml | 5 + .github/workflows/ci.yml | 6 +- flake.lock | 6 +- flake.nix | 70 +++++++---- lib/Echidna/UI.hs | 55 ++++----- lib/Echidna/UI/Widgets.hs | 13 +- package.yaml | 112 +++++++++--------- stack.yaml | 11 +- 9 files changed, 149 insertions(+), 137 deletions(-) create mode 100644 .github/container-linux-static/stack-config.yaml diff --git a/.github/container-linux-static/Dockerfile b/.github/container-linux-static/Dockerfile index 3b37e2bcc..9ab126465 100644 --- a/.github/container-linux-static/Dockerfile +++ b/.github/container-linux-static/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.18.4 +FROM alpine:3.18.6 # Based on https://github.com/fpco/alpine-haskell-stack/blob/9.2.8v2/ghc-Dockerfile RUN apk upgrade --no-cache &&\ @@ -36,12 +36,12 @@ RUN ln -s /usr/lib/libncurses.a /usr/lib/libtinfo.a COPY stack-config.yaml /root/.stack/config.yaml RUN cd /tmp && \ - curl -sSLo /tmp/ghc.tar.xz https://downloads.haskell.org/~ghc/9.4.7/ghc-9.4.7-x86_64-alpine3_12-linux.tar.xz && \ + curl -sSLo /tmp/ghc.tar.xz https://downloads.haskell.org/~ghc/9.6.5/ghc-9.6.5-x86_64-alpine3_12-linux.tar.xz && \ tar xf ghc.tar.xz && \ - cd ghc-9.4.7-x86_64-unknown-linux && \ + cd ghc-9.6.5-x86_64-unknown-linux && \ ./configure --prefix=/usr/local && \ make install && \ - rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.4.7-x86_64-unknown-linux + rm -rf /tmp/ghc.tar.xz /tmp/ghc-9.6.5-x86_64-unknown-linux RUN apk upgrade --no-cache &&\ apk add --no-cache \ diff --git a/.github/container-linux-static/stack-config.yaml b/.github/container-linux-static/stack-config.yaml new file mode 100644 index 000000000..9b5d485a6 --- /dev/null +++ b/.github/container-linux-static/stack-config.yaml @@ -0,0 +1,5 @@ +extra-include-dirs: +- /usr/include +extra-lib-dirs: +- /lib +- /usr/lib diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 182a3dc4e..138b53cd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: # Tag for cache invalidation - CACHE_VERSION: v6 + CACHE_VERSION: v7 jobs: build: @@ -22,7 +22,7 @@ jobs: include: - os: ubuntu-20.04 shell: bash - container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.4.7\", \"options\": \"--user 1001\"}" + container: "{\"image\": \"elopeztob/alpine-haskell-stack-echidna:ghc-9.6.5\", \"options\": \"--user 1001\"}" - os: macos-13 # x86_64 macOS shell: bash - os: windows-latest @@ -65,7 +65,7 @@ jobs: id: stack if: matrix.container == '' with: - ghc-version: '9.4' + ghc-version: '9.6' enable-stack: true stack-version: 'latest' diff --git a/flake.lock b/flake.lock index 6f81b13f4..fc545ab1e 100644 --- a/flake.lock +++ b/flake.lock @@ -52,11 +52,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1703499205, - "narHash": "sha256-lF9rK5mSUfIZJgZxC3ge40tp1gmyyOXZ+lRY3P8bfbg=", + "lastModified": 1720368505, + "narHash": "sha256-5r0pInVo5d6Enti0YwUSQK4TebITypB42bWy5su3MrQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e1fa12d4f6c6fe19ccb59cac54b5b3f25e160870", + "rev": "ab82a9612aa45284d4adf69ee81871a389669a9e", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index b774761bb..0e4157443 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,7 @@ pkgs = nixpkgs.legacyPackages.${system}; # prefer musl on Linux, static glibc + threading does not work properly # TODO: maybe only override it for echidna-redistributable? - pkgsStatic = if pkgs.stdenv.hostPlatform.isLinux then pkgs.pkgsMusl else pkgs; + pkgsStatic = if pkgs.stdenv.hostPlatform.isLinux then pkgs.pkgsStatic else pkgs; # this is not perfect for development as it hardcodes solc to 0.5.7, test suite runs fine though # would be great to integrate solc-select to be more flexible, improve this in future solc = pkgs.stdenv.mkDerivation { @@ -47,39 +47,61 @@ ncurses-static = pkgsStatic.ncurses.override { enableStatic = true; }; - hevm = pkgs: pkgs.haskell.lib.dontCheck ( - pkgs.haskellPackages.callCabal2nix "hevm" (pkgs.fetchFromGitHub { + hsPkgs = ps : + ps.haskellPackages.override { + overrides = hfinal: hprev: { + with-utf8 = + if (with ps.stdenv; hostPlatform.isDarwin && hostPlatform.isx86) + then ps.haskell.lib.compose.overrideCabal (_ : { extraLibraries = [ps.libiconv]; }) hprev.with-utf8 + else hprev.with-utf8; + }; + }; + + cc-workaround-nix-23138 = + pkgs.writeScriptBin "cc-workaround-nix-23138" '' + if [ "$1" = "--print-file-name" ] && [ "$2" = "c++" ]; then + echo c++ + else + exec cc "$@" + fi + ''; + + hevm = pkgs: pkgs.lib.pipe ((hsPkgs pkgs).callCabal2nix "hevm" (pkgs.fetchFromGitHub { owner = "trail-of-forks"; repo = "hevm"; - rev = "7d4344c5e71d14466e86331af064bab61d06bdad"; - sha256 = "sha256-kts6mdwx5KUrVdNztzewWgNM9xGViAhFIZPnWOUllOU="; - }) { secp256k1 = pkgs.secp256k1; }); + rev = "3aba82f06a2d1e0a4a4c26458f747a46dad0e7e2"; + sha256 = "sha256-NXXhEqHTQEL2N9RhXa1eczIsQtIM3mvPfyWXlBXpxK4="; + }) { secp256k1 = pkgs.secp256k1; }) + ([ + pkgs.haskell.lib.compose.dontCheck + ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + (pkgs.haskell.lib.compose.appendConfigureFlag "--ghc-options=-pgml=${cc-workaround-nix-23138}/bin/cc-workaround-nix-23138") + ]); - # FIXME: figure out solc situation, it conflicts with the one from - # solc-select that is installed with slither, disable tests in the meantime - echidna = pkgs: pkgs.haskell.lib.dontCheck ( - with pkgs; lib.pipe - (haskellPackages.callCabal2nix "echidna" ./. { hevm = hevm pkgs; }) - [ + echidna = pkgs: with pkgs; lib.pipe + ((hsPkgs pkgs).callCabal2nix "echidna" ./. { hevm = hevm pkgs; }) + ([ + # FIXME: figure out solc situation, it conflicts with the one from + # solc-select that is installed with slither, disable tests in the meantime + haskell.lib.compose.dontCheck (haskell.lib.compose.addTestToolDepends [ haskellPackages.hpack slither-analyzer solc ]) (haskell.lib.compose.disableCabalFlag "static") + ] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ + (pkgs.haskell.lib.compose.appendConfigureFlag "--ghc-options=-pgml=${cc-workaround-nix-23138}/bin/cc-workaround-nix-23138") ]); echidna-static = with pkgsStatic; lib.pipe (echidna pkgsStatic) [ (haskell.lib.compose.appendConfigureFlags - ([ + [ "--extra-lib-dirs=${stripDylib (gmp.override { withStatic = true; })}/lib" "--extra-lib-dirs=${stripDylib secp256k1-static}/lib" "--extra-lib-dirs=${stripDylib (libff.override { enableStatic = true; })}/lib" - "--extra-lib-dirs=${zlib.static}/lib" + "--extra-lib-dirs=${zlib.override { static = true; shared = false; }}/lib" "--extra-lib-dirs=${stripDylib (libffi.overrideAttrs (_: { dontDisableStatic = true; }))}/lib" "--extra-lib-dirs=${stripDylib (ncurses-static)}/lib" - ] ++ (if stdenv.hostPlatform.isDarwin then [ - "--extra-lib-dirs=${stripDylib (libiconv.override { enableStatic = true; })}/lib" - "--extra-lib-dirs=${stripDylib (libcxxabi)}/lib" - ] else []))) + ]) (haskell.lib.compose.enableCabalFlag "static") ]; @@ -108,10 +130,14 @@ # get the list of dynamic libs from otool and tidy the output libs=$(${otool} -L $out/bin/echidna | tail -n +2 | sed 's/^[[:space:]]*//' | cut -d' ' -f1) # get the path for libcxx - cxx=$(echo "$libs" | ${grep} '^/nix/store/.*-libcxx-') + cxx=$(echo "$libs" | ${grep} '^/nix/store/.*/libc++\.') + cxxabi=$(echo "$libs" | ${grep} '^/nix/store/.*/libc++abi\.') + iconv=$(echo "$libs" | ${grep} '^/nix/store/.*/libiconv\.') # rewrite /nix/... library paths to point to /usr/lib chmod 777 $out/bin/echidna ${install_name_tool} -change "$cxx" /usr/lib/libc++.1.dylib $out/bin/echidna + ${install_name_tool} -change "$cxxabi" /usr/lib/libc++abi.dylib $out/bin/echidna + ${install_name_tool} -change "$iconv" /usr/lib/libiconv.dylib $out/bin/echidna # fix TERMINFO path in ncurses ${perl} -i -pe 's#(${ncurses-static}/share/terminfo)#"/usr/share/terminfo" . "\x0" x (length($1) - 19)#e' $out/bin/echidna # check that no nix deps remain @@ -145,7 +171,11 @@ devShell = with pkgs; haskellPackages.shellFor { packages = _: [ (echidna pkgs) ]; - shellHook = "hpack"; + shellHook = '' + hpack + '' + (if pkgs.stdenv.isDarwin then '' + cabal configure --ghc-options=-pgml=${cc-workaround-nix-23138}/bin/cc-workaround-nix-23138 + '' else ""); buildInputs = [ solc slither-analyzer diff --git a/lib/Echidna/UI.hs b/lib/Echidna/UI.hs index 5387aed51..dcbccdc13 100644 --- a/lib/Echidna/UI.hs +++ b/lib/Echidna/UI.hs @@ -1,19 +1,10 @@ {-# LANGUAGE CPP #-} -{-# OPTIONS_GHC -Wno-unused-imports #-} module Echidna.UI where -#ifdef INTERACTIVE_UI import Brick import Brick.BChan import Brick.Widgets.Dialog qualified as B -import Data.Sequence ((|>)) -import Graphics.Vty (Config, Event(..), Key(..), Modifier(..), defaultConfig, inputMap, mkVty) -import Graphics.Vty qualified as Vty -import System.Posix -import Echidna.UI.Widgets -#endif - import Control.Concurrent (killThread, threadDelay) import Control.Exception (AsyncException) import Control.Monad @@ -24,14 +15,20 @@ import Control.Monad.ST (RealWorld) import Data.ByteString.Lazy qualified as BS import Data.List.Split (chunksOf) import Data.Map (Map) -import Data.Maybe (fromMaybe, isJust) +import Data.Maybe (isJust) +import Data.Sequence ((|>)) import Data.Text (Text) import Data.Time +import Graphics.Vty.Config (VtyUserConfig, defaultConfig, configInputMap) +import Graphics.Vty.CrossPlatform (mkVty) +import Graphics.Vty.Input.Events +import Graphics.Vty qualified as Vty +import System.Console.ANSI (hNowSupportsANSI) +import System.Signal import UnliftIO ( MonadUnliftIO, IORef, newIORef, readIORef, hFlush, stdout , writeIORef, timeout) import UnliftIO.Concurrent hiding (killThread, threadDelay) -import EVM.Solidity (SolcContract) import EVM.Types (Addr, Contract, VM, VMType(Concrete), W256) import Echidna.ABI @@ -43,11 +40,10 @@ import Echidna.Types.Campaign import Echidna.Types.Config import Echidna.Types.Corpus qualified as Corpus import Echidna.Types.Coverage (scoveragePoints) -import Echidna.Types.Solidity (SolConf(..)) import Echidna.Types.Test (EchidnaTest(..), didFail, isOptimizationTest) import Echidna.Types.Tx (Tx) -import Echidna.Types.World (World) import Echidna.UI.Report +import Echidna.UI.Widgets import Echidna.Utility (timePrefix, getTimestamp) data UIEvent = @@ -93,7 +89,6 @@ ui vm dict initialCorpus cliSelectedContract = do uncurry (spawnWorker env perWorkerTestLimit) case effectiveMode of -#ifdef INTERACTIVE_UI Interactive -> do -- Channel to push events to update UI uiChannel <- liftIO $ newBChan 1000 @@ -157,20 +152,17 @@ ui vm dict initialCorpus cliSelectedContract = do liftIO . putStrLn =<< ppCampaign vm states pure states -#else - Interactive -> error "Interactive UI is not available" -#endif NonInteractive outputFormat -> do serverStopVar <- newEmptyMVar -#ifdef INTERACTIVE_UI - -- Handles ctrl-c, TODO: this doesn't work on Windows + + -- Handles ctrl-c liftIO $ forM_ [sigINT, sigTERM] $ \sig -> - let handler = Catch $ do + let handler _ = do stopWorkers workers void $ tryPutMVar serverStopVar () - in installHandler sig handler Nothing -#endif + in installHandler sig handler + let forwardEvent ev = putStrLn =<< runReaderT (ppLogLine vm ev) env uiEventsForwarderStopVar <- spawnListener forwardEvent @@ -245,7 +237,6 @@ ui vm dict initialCorpus cliSelectedContract = do workerStates workers = forM workers $ \(_, stateRef) -> readIORef stateRef -#ifdef INTERACTIVE_UI -- | Order the workers to stop immediately stopWorkers :: MonadIO m => [(ThreadId, IORef WorkerState)] -> m () stopWorkers workers = @@ -253,12 +244,12 @@ stopWorkers workers = workerState <- readIORef workerStateRef liftIO $ mapM_ killThread (threadId : workerState.runningThreads) -vtyConfig :: IO Config +vtyConfig :: IO VtyUserConfig vtyConfig = do - config <- Vty.standardIOConfig - pure config { inputMap = (Nothing, "\ESC[6;2~", EvKey KPageDown [MShift]) : - (Nothing, "\ESC[5;2~", EvKey KPageUp [MShift]) : - inputMap defaultConfig } + pure defaultConfig { configInputMap = [ + (Nothing, "\ESC[6;2~", EvKey KPageDown [MShift]), + (Nothing, "\ESC[5;2~", EvKey KPageUp [MShift]) + ] } -- | Check if we should stop drawing (or updating) the dashboard, then do the right thing. monitor :: MonadReader Env m => m (App UIState UIEvent Name) @@ -336,16 +327,10 @@ monitor = do , appAttrMap = const attrs , appChooseCursor = neverShowCursor } -#endif -- | Heuristic check that we're in a sensible terminal (not a pipe) isTerminal :: IO Bool -isTerminal = -#ifdef INTERACTIVE_UI - (&&) <$> queryTerminal (Fd 0) <*> queryTerminal (Fd 1) -#else - pure False -#endif +isTerminal = hNowSupportsANSI stdout -- | Composes a compact text status line of the campaign statusLine diff --git a/lib/Echidna/UI/Widgets.hs b/lib/Echidna/UI/Widgets.hs index a343eb0b9..cfa851bf3 100644 --- a/lib/Echidna/UI/Widgets.hs +++ b/lib/Echidna/UI/Widgets.hs @@ -2,8 +2,6 @@ module Echidna.UI.Widgets where -#ifdef INTERACTIVE_UI - import Brick hiding (style) import Brick.AttrMap qualified as A import Brick.Widgets.Border @@ -147,14 +145,14 @@ logPane uiState = showLogLine :: (LocalTime, CampaignEvent) -> Widget Name showLogLine (time, event@(WorkerEvent workerId workerType _)) = - (withAttr (attrName "time") $ str $ (timePrefix time) <> "[Worker " <> show workerId <> symSuffix <> "] ") + withAttr (attrName "time") (str $ timePrefix time <> "[Worker " <> show workerId <> symSuffix <> "] ") <+> strBreak (ppCampaignEvent event) where symSuffix = case workerType of SymbolicWorker -> ", symbolic" _ -> "" showLogLine (time, event) = - (withAttr (attrName "time") $ str $ (timePrefix time) <> " ") <+> strBreak (ppCampaignEvent event) + withAttr (attrName "time") (str $ timePrefix time <> " ") <+> strBreak (ppCampaignEvent event) summaryWidget :: Env -> UIState -> Widget Name summaryWidget env uiState = @@ -187,7 +185,7 @@ summaryWidget env uiState = <=> str ("New coverage: " <> timeElapsed uiState uiState.lastNewCov <> " ago") <+> fill ' ' rightSide = - padLeft (Pad 1) $ + padLeft (Pad 1) (rpcInfoWidget uiState.fetchedContracts uiState.fetchedSlots env.chainId) timeElapsed :: UIState -> LocalTime -> String @@ -324,7 +322,7 @@ tracesWidget vm = do let traces = stripAnsiEscapeCodes $ showTraceTree dappInfo vm pure $ if T.null traces then str "" - else str "Traces" <+> str ":" <=> (txtBreak traces) + else str "Traces" <+> str ":" <=> txtBreak traces failWidget :: MonadReader Env m @@ -343,7 +341,6 @@ failWidget b test = do ( failureBadge <+> str (" with " ++ show test.result) , shrinkWidget b test <=> titleWidget <=> s <=> str " " <=> traces ) - where optWidget :: MonadReader Env m @@ -406,5 +403,3 @@ strBreak = strWrapWith $ defaultWrapSettings { breakLongWords = True } txtBreak :: Text -> Widget n txtBreak = txtWrapWith $ defaultWrapSettings { breakLongWords = True } - -#endif diff --git a/package.yaml b/package.yaml index 2e4cc7093..b6732053a 100644 --- a/package.yaml +++ b/package.yaml @@ -9,56 +9,22 @@ ghc-options: - -O2 - -Wall - -fno-warn-orphans + - -feager-blackholing # https://github.com/haskell/cabal/issues/4739 - -optP-Wno-nonportable-include-path - -fspecialize-aggressively - -fexpose-all-unfoldings + - -Wunused-packages dependencies: - - base - aeson - - async - - base16-bytestring - - binary - - bytestring - - code-page + - base - containers - - data-bword - - data-dword - - deepseq - - extra - directory - - exceptions - - filepath - - hashable - hevm - - html-entities - - ListLike - MonadRandom - mtl - - optparse-applicative - - optics - - optics-core - - process - - random - - rosezipper - - semver - - split - text - - transformers - - time - - unliftio - - utf8-string - - vector - - with-utf8 - - word-wrap - - yaml - - http-conduit - - html-conduit - - warp - - wai-extra - - xml-conduit - - strip-ansi-escape language: GHC2021 @@ -74,20 +40,57 @@ default-extensions: library: source-dirs: lib/ - -when: - - condition: "!os(windows)" - cpp-options: -DINTERACTIVE_UI - dependencies: - - brick - - unix - - vty + dependencies: + - ansi-terminal + - async + - base16-bytestring + - binary + - brick + - bytestring + - data-bword + - data-dword + - deepseq + - exceptions + - extra + - filepath + - hashable + - html-conduit + - html-entities + - http-conduit + - ListLike + - optics + - optics-core + - process + - random + - rosezipper + - semver + - signal + - split + - strip-ansi-escape + - time + - unliftio + - utf8-string + - vector + - vty + - vty-crossplatform + - wai-extra + - warp + - word-wrap + - xml-conduit + - yaml executables: echidna: main: Main.hs source-dirs: src/ - dependencies: echidna + dependencies: + - code-page + - echidna + - filepath + - hashable + - optparse-applicative + - time + - with-utf8 ghc-options: - -threaded - '"-with-rtsopts=-A64m -N"' @@ -100,23 +103,25 @@ executables: - -O2 - -optl-pthread - condition: os(darwin) - extra-libraries: c++ ld-options: -Wl,-keep_dwarf_unwind ghc-options: -fcompact-unwind - - condition: os(windows) && impl(ghc >= 9.4) - dependencies: system-cxx-std-lib - - condition: os(windows) && impl(ghc < 9.4) - extra-libraries: stdc++ tests: echidna-testsuite: main: Spec.hs source-dirs: src/test dependencies: + - data-dword - echidna + - exceptions + - optics-core + - process + - semver + - split - tasty - tasty-hunit - tasty-quickcheck + - yaml when: - condition: (os(linux) || os(windows)) && flag(static) ghc-options: @@ -126,13 +131,8 @@ tests: - -O2 - -optl-pthread - condition: os(darwin) - extra-libraries: c++ ld-options: -Wl,-keep_dwarf_unwind ghc-options: -fcompact-unwind - - condition: os(windows) && impl(ghc >= 9.4) - dependencies: system-cxx-std-lib - - condition: os(windows) && impl(ghc < 9.4) - extra-libraries: stdc++ flags: static: diff --git a/stack.yaml b/stack.yaml index d63fc4282..12aa54f57 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,17 +1,14 @@ -resolver: lts-21.17 +resolver: lts-22.19 packages: - '.' extra-deps: - git: https://github.com/trail-of-forks/hevm.git - commit: 7d4344c5e71d14466e86331af064bab61d06bdad + commit: 3aba82f06a2d1e0a4a4c26458f747a46dad0e7e2 -- restless-git-0.7@sha256:346a5775a586f07ecb291036a8d3016c3484ccdc188b574bcdec0a82c12db293,968 -- s-cargot-0.1.4.0@sha256:61ea1833fbb4c80d93577144870e449d2007d311c34d74252850bb48aa8c31fb,3525 -- semver-range-0.2.8@sha256:44918080c220cf67b6e7c8ad16f01f3cfe1ac69d4f72e528e84d566348bb23c3,1941 -- HSH-2.1.3@sha256:71ded11b224f5066373ce985ec63b10c87129850b33916736dd64fa2bea9ea0a,1705 -- spool-0.1@sha256:77780cbfc2c0be23ff2ea9e474062f3df97fcd9db946ee0b3508280a923b83e2,1461 - smt2-parser-0.1.0.1@sha256:1e1a4565915ed851c13d1e6b8bb5185cf5d454da3b43170825d53e221f753d77,1421 - spawn-0.3@sha256:b91e01d8f2b076841410ae284b32046f91471943dc799c1af77d666c72101f02,1162 +- spool-0.1@sha256:77780cbfc2c0be23ff2ea9e474062f3df97fcd9db946ee0b3508280a923b83e2,1461 - strip-ansi-escape-0.1.0.0@sha256:08f2ed93b16086a837ec46eab7ce8d27cf39d47783caaeb818878ea33c2ff75f,1628 +- vty-windows-0.2.0.3@sha256:0c010b1086a725046a8bb08bb1e6bfdfdb3cfe1c72d6fa77c37306ef9ec774d8,2844