input-output-hk / mithril

Stake-based threshold multi-signatures protocol
https://mithril.network
Apache License 2.0
115 stars 36 forks source link

Implement pooled resource item reset when given back #1744

Closed jpraynaud closed 3 weeks ago

jpraynaud commented 3 weeks ago

Content

When resources are given back to a resource pool (e.g. Merkle maps in the Cardano transaction prover), they need to be reset properly (e.g. the Merkle map should be compressed so that all its values are represented by their root). This will guarantee that pooled resources are consistent and do not depend from previous computations. (e.g. this will avoid the risk of memory overflow and provide a consistent proving time).

This PR includes:

Benchmarks

Screenshot from 2024-06-11 18-08-01

Total Requests Concurrency Transactions/Request Pool (x50) : Request/s Pool (x50) + Reset given back pooled MKMaps: Request/s
1000 100 1 1380.67 1378.26
1000 100 2 472.86 472.56
1000 100 3 294.02 289.8
1000 100 4 255.05 247.36
1000 100 5 160.5 148.61
1000 100 6 142.99 141.09
1000 100 7 117.91 117.81
1000 100 8 107.07 105.44
1000 100 9 85.94 85.38
1000 100 10 86.75 83.74

Running on Linux / 8 cores / 64 GB RAM / 2 TB SSD

Pre-submit checklist

Issue(s)

Closes #1743

github-actions[bot] commented 3 weeks ago

Test Results

    3 files  ±0     43 suites  ±0   8m 52s :stopwatch: +12s 1 036 tests +1  1 036 :white_check_mark: +1  0 :zzz: ±0  0 :x: ±0  1 134 runs  +1  1 134 :white_check_mark: +1  0 :zzz: ±0  0 :x: ±0 

Results for commit 80dc8176. ± Comparison against base commit 0c3ee098.

:recycle: This comment has been updated with latest results.