No description provided.
fuzz: Add utxo_snapshot target #21953
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2104-assumeutxoCrash02 changing 6 files +132 −6-
MarcoFalke commented at 10:07 AM on May 15, 2021: member
- fanquake added the label Tests on May 15, 2021
-
practicalswift commented at 11:31 AM on May 15, 2021: contributor
Concept ACK
Very nice! :)
-
fuzz: Add utxo_snapshot target fa91994b1b
- MarcoFalke force-pushed on May 16, 2021
-
in src/test/fuzz/utxo_snapshot.cpp:72 in fa91994b1b
67 | + Assert(*chainman.ActiveChainstate().m_from_snapshot_blockhash == 68 | + *chainman.SnapshotBlockhash()); 69 | + const auto& coinscache{chainman.ActiveChainstate().CoinsTip()}; 70 | + int64_t chain_tx{}; 71 | + for (const auto& block : *g_chain) { 72 | + Assert(coinscache.HaveCoin(COutPoint{block->vtx.at(0)->GetHash(), 0}));
jamesob commented at 3:19 PM on May 20, 2021:Just out of curiosity - if we've gotten here, that means that the fuzzer has provided random input that has happened to correspond to a utxo snapshot that matches the chain we've generated in setup. This seems extraordinarily unlikely to me; how often do we expect this to actually happen? Am I missing some mechanic about how the fuzzer works that makes this a more frequent thing?
MarcoFalke commented at 6:53 PM on May 21, 2021:Right, I expect this to be impossible unless one of the initial seed inputs is a valid snapshot.
MarcoFalke commented at 11:20 AM on May 22, 2021:Full coverage (as of now): https://marcofalke.github.io/btc_cov/fuzz.coverage/src/test/fuzz/utxo_snapshot.cpp.gcov.html
adamjonas commented at 10:30 PM on May 20, 2021: memberFuzzed
utxo_snapshotwith fa91994 and did see modest coverage gains. Naively wondering whether if it'd be possible to improve the execution speed.<details> <summary>Log</summary>
[#2](/bitcoin-bitcoin/2/) pulse ft: 36401 exec/s: 0 rss: 547Mb [#4](/bitcoin-bitcoin/4/) pulse cov: 36733 ft: 36457 corp: 2/2b exec/s: 0 rss: 561Mb [#8](/bitcoin-bitcoin/8/) pulse cov: 36749 ft: 36458 corp: 3/3b exec/s: 0 rss: 582Mb [#16](/bitcoin-bitcoin/16/) pulse cov: 36750 ft: 36460 corp: 4/4b exec/s: 0 rss: 624Mb [#32](/bitcoin-bitcoin/32/) pulse cov: 36750 ft: 36461 corp: 6/6b exec/s: 1 rss: 695Mb [#64](/bitcoin-bitcoin/64/) pulse cov: 36751 ft: 36472 corp: 10/10b exec/s: 2 rss: 789Mb [#128](/bitcoin-bitcoin/128/) pulse cov: 36751 ft: 36475 corp: 12/12b exec/s: 4 rss: 790Mb [#256](/bitcoin-bitcoin/256/) pulse cov: 36751 ft: 36475 corp: 12/12b exec/s: 6 rss: 790Mb [#512](/bitcoin-bitcoin/512/) pulse cov: 36751 ft: 36475 corp: 12/12b exec/s: 9 rss: 790Mb [#1024](/bitcoin-bitcoin/1024/) pulse cov: 36759 ft: 36511 corp: 18/24b exec/s: 13 rss: 790Mb [#2048](/bitcoin-bitcoin/2048/) pulse cov: 36761 ft: 36544 corp: 23/36b exec/s: 15 rss: 790Mb [#4096](/bitcoin-bitcoin/4096/) pulse cov: 37753 ft: 40612 corp: 56/151b exec/s: 16 rss: 790Mb [#8192](/bitcoin-bitcoin/8192/) pulse cov: 37754 ft: 40812 corp: 106/426b exec/s: 16 rss: 790Mb ...</details>
MarcoFalke commented at 6:38 AM on May 21, 2021: memberNaively wondering whether if it'd be possible to improve the execution speed.
Sure, just set the tempdir to a ramdisk
MarcoFalke commented at 6:48 AM on May 21, 2021: memberFor refrerence, I am getting
[#3502](/bitcoin-bitcoin/3502/) NEW cov: 4861 ft: 5258 corp: 79/859b lim: 17 exec/s: 106 rss: 91Mb L: 17/17 MS: 1 CopyPart-jamesob approvedjamesob commented at 1:32 PM on May 21, 2021: memberACK https://github.com/bitcoin/bitcoin/pull/21953/commits/fa91994b1b9b6da3bb2a2f722d9251d7d0f2167e
I'm in the process of trying to get this to run locally, but have reviewed the code and it looks like a great start. We could maybe save some cycles by conditionally prepending valid snapshot metadata to the file we construct (in the same way that we conditionally have the background chainstate synced to the snapshot base), but in any case this is a good change.
I'll report back with logs when I get this running.
jamesob commented at 6:56 PM on May 21, 2021: memberTested ACK
Ran it locally for a while:
#9331 NEW cov: 18641 ft: 21159 corp: 162/2883b lim: 38 exec/s: 17 rss: 549Mb L: 25/36 MS: 2 InsertByte-PersAutoDict- DE: "debuglogf"-MarcoFalke merged this on May 22, 2021MarcoFalke closed this on May 22, 2021MarcoFalke deleted the branch on May 22, 2021practicalswift commented at 8:23 AM on May 22, 2021: contributorPost-merge tested ACK fa91994b1b9b6da3bb2a2f722d9251d7d0f2167e
$ FUZZ=utxo_snapshot src/test/fuzz/fuzz utxo_snapshot/ … INFO: 266 files found in utxo_snapshot/ … [#16](/bitcoin-bitcoin/16/) pulse cov: 20394 ft: 20311 corp: 5/6b exec/s: 8 rss: 241Mb … [#267](/bitcoin-bitcoin/267/) INITED cov: 22144 ft: 29197 corp: 145/5368b exec/s: 3 rss: 497Mbutxo_snapshot/created from thin air during ~8 hours of fuzzing.sidhujag referenced this in commit 0ade921c40 on May 24, 2021gwillen referenced this in commit 2a2bbdaee3 on Jun 1, 2022DrahtBot locked this on Aug 18, 2022ContributorsLabels
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC
More mirrored repositories can be found on mirror.b10c.me