rgb-cln/bitcoin/test
Rusty Russell 5e3e2f4e17 run-secret_eq_consttime: try harder.
This will never be reliable under high load, without making it unable
to detect real errors.  But the test is useful because if we don't
have this test we'll never notice if we break the const-timedness of
our implementation.

So, move the calloc out of the test loop (which seems to make it more
reliable), and then after we've run it, check the 1-minute load
average.  Too high, we don't complain about results.  It's not
perfect, but it's better.

Running 100 times (-O3) serially gave 100 successes with the following results:
	Constant: Within 5% 562-926(832.89+/-73)/1000 times
        Non-constant: More than 5% slower 860-990(956.35+/-26)/1000 times

More importantly, if we swap the const and non-const tests, we get
the expected 100 failures:
	Non-constant: Within 5% 14-79(41.17+/-14)/1000 times
	Constant: More than 5% slower 44-231(111.89+/-33)/1000 times

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-08-29 09:01:48 +02:00
..
Makefile bitcoin: Add chainparams to transactions from blocks 2019-07-31 23:22:54 +00:00
run-bitcoin_block_from_hex.c bitcoin: Add chainparams to transactions from blocks 2019-07-31 23:22:54 +00:00
run-secret_eq_consttime.c run-secret_eq_consttime: try harder. 2019-08-29 09:01:48 +02:00
run-tx-encode.c bitcoin/tx: use fromwire_fail in pull_bitcoin_tx. 2019-06-21 03:56:59 +00:00