mlabs-haskell / clb

Cardano Node Emulator (next-gen PSM)
7 stars 3 forks source link

Use mocked crypto for speeding up #31

Open uhbif19 opened 7 months ago

uhbif19 commented 7 months ago
          No, we use an instance of `Cardano.Ledger.Crypto.Crypto`, which is [`StandardCrypto`](https://github.com/IntersectMBO/cardano-ledger/blob/master/libs/cardano-ledger-core/src/Cardano/Ledger/Crypto.hs#L40-L45). By using mock hashes we can probably speed everything up a bit. Take a look [here](https://github.com/IntersectMBO/cardano-ledger/blob/master/eras/shelley/test-suite/src/Test/Cardano/Ledger/Shelley/ConcreteCryptoTypes.hs#L52-L57).

`

Originally posted by @euonymos in https://github.com/mlabs-haskell/clb/issues/24#issuecomment-2025939180

uhbif19 commented 5 months ago

@euonymos BTW while profiling CEM script I did not seen any crypto impact on flamechart.

While PSM takes only part of CEM test time, it seems plausible to me that crypto does take much time, cuz Ledger takes really large time and hashing seem not. I checked blake2 with Python intepreter, it takes around a second to count such hash on 70k byte string 10k times. Maybe it is different for signing though.

Also I am not sure what how to mock it :D