Skip to content

Commit

Permalink
(debug) print e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-valerio committed Nov 28, 2024
1 parent 4f3a92b commit ec37d22
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
5 changes: 3 additions & 2 deletions book/documentation/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -929,13 +929,14 @@ <h3 id="support-channels"><a class="header" href="#support-channels">Support cha
<p>Benchmarking provides insights into Phink’s performance in real-world scenarios, in order to vizualise its efficiency
and
fuzzing ink! smart contracts. Below are the benchmark results for various smart contracts, detailing
coverage, speed, corpus size, and the potential usage of <code>generate-seed</code>. Each contract were fuzzed for maximum a day.
coverage, speed, corpus size, and the potential usage of <code>generate-seed</code>.
Each contract were fuzzed for maximum a day.
Statistics (especially <em>average speed</em>) are given for <strong>one</strong> core only. The coverage percent is calculated using the
number of
lines covered divided the number of reachable lines, as a percentage.</p>
<h3 id="benchmarks"><a class="header" href="#benchmarks">Benchmarks</a></h3>
<div class="table-wrapper"><table><thead><tr><th>Contract name</th><th>Coverage percent</th><th>Average speed (<em>execs/sec</em>)</th><th>AFL++ corpus size</th><th>Using Phink seed generation</th></tr></thead><tbody>
<tr><td>abax_governor</td><td><strong>48%</strong></td><td>1500 (early phase) / 100 (late phase)</td><td>1639</td><td><strong>NO</strong> (no tests available)</td></tr>
<tr><td>abax_governor</td><td><strong>48%</strong></td><td>1500 (early phase) <strong>and</strong> 100 (late phase)</td><td>1639</td><td><strong>NO</strong> (no tests available)</td></tr>
<tr><td>multisig</td><td><strong>91%</strong></td><td>113 (late phase)</td><td>1524</td><td><strong>YES</strong> (without E2E)</td></tr>
</tbody></table>
</div>
Expand Down
2 changes: 1 addition & 1 deletion book/documentation/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion book/documentation/searchindex.json

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions book/src/BENCHMARKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
Benchmarking provides insights into Phink's performance in real-world scenarios, in order to vizualise its efficiency
and
fuzzing ink! smart contracts. Below are the benchmark results for various smart contracts, detailing
coverage, speed, corpus size, and the potential usage of `generate-seed`. Each contract were fuzzed for maximum a day.
coverage, speed, corpus size, and the potential usage of `generate-seed`.
Each contract were fuzzed for maximum a day.
Statistics (especially *average speed*) are given for **one** core only. The coverage percent is calculated using the
number of
lines covered divided the number of reachable lines, as a percentage.

### Benchmarks

| Contract name | Coverage percent | Average speed (_execs/sec_) | AFL++ corpus size | Using Phink seed generation |
|---------------|------------------|---------------------------------------|-------------------|-----------------------------|
| abax_governor | **48%** | 1500 (early phase) / 100 (late phase) | 1639 | **NO** (no tests available) |
| multisig | **91%** | 113 (late phase) | 1524 | **YES** (without E2E) |
| Contract name | Coverage percent | Average speed (_execs/sec_) | AFL++ corpus size | Using Phink seed generation |
|---------------|------------------|---------------------------------------------|-------------------|-----------------------------|
| abax_governor | **48%** | 1500 (early phase) **and** 100 (late phase) | 1639 | **NO** (no tests available) |
| multisig | **91%** | 113 (late phase) | 1524 | **YES** (without E2E) |

- Github for
`abax_governor` : [https://github.com/AbaxFinance/dao-contracts/tree/main/src/contracts/abax_governor](https://github.com/AbaxFinance/dao-contracts/tree/main/src/contracts/abax_governor)
Expand Down
6 changes: 6 additions & 0 deletions src/instrumenter/seedgen/generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,13 @@ impl SeedExtractInjector {
.context("Couldn't run `cargo test ...` to run the seeds")?;

let amount = self.save_seeds(unparsed_seed, output)?;

if self.verbose() {
if is_e2e {
println!(
"The contract has the e2e-tests features, so we run seed generator with E2E."
);
}
println!(
"\nDone! We've saved {amount} seeds in total. If your campaign already started,\
you can use `cargo ziggy add-seeds` to include the seeds."
Expand Down

0 comments on commit ec37d22

Please sign in to comment.