Skip to content

fuzz: Add PartiallyDownloadedBlock target - #26898

Merged
maflcko merged 4 commits into
bitcoin:masterfrom
dergoegge:2023-11-pdb-fuzz
Jan 24, 2023
Merged

maflcko merged 4 commits into
bitcoin:masterfrom
dergoegge:2023-11-pdb-fuzz

Conversation

@dergoegge

Copy link
Copy Markdown
Member

This PR adds a fuzz target for PartiallyDownloadedBlock, which we currently do not have any coverage for.

@DrahtBot

DrahtBot commented Jan 16, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK mzumsande, MarcoFalke
Concept ACK sipa

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Tests label Jan 16, 2023

@mzumsande mzumsande left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, only minor comments

Comment thread src/blockencodings.cpp Resolved
@sipa

sipa commented Jan 20, 2023

Copy link
Copy Markdown
Member

Concept ACK

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on improved fuzz targets!

I've left some nano-nits that can be ignored. Please let us know if you want this merged or want to address the nits.

review ACK b350ffd07c04d3b499f5960973d664d699341ec1 🎧

Show signature

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

review ACK b350ffd07c04d3b499f5960973d664d699341ec1 🎧
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUgq+Av/em84tR5X4rXmHJSeQPxVnzZUNBTZYXwnjL+A3EbtpxWP+ne/jGTdkj43
URmm15WNSbKeLKTR3w+FbdcgNbGuyfRlx6tJsvKNFbAMZtEvR4Ezs7WxZmQKdLAa
DHsp3Tpfe+axMgu1TGpx1JZ2+wC+6pDYDqMvAh2yLkN1NHUrHEToVwIN2r4z2+Nl
0adRB0cxh7WF9VGN4twevz5AAoIEXMhlmDXEGJO8ljFyBbkxmTDtYcYzgRxdQVig
Ok9JoNuFxxVQeBTC1TeloGCqXAapwS+ZVQul0NpEsWejD29jGGi+/kw3qOXq3HjI
Kmb/K/6zNMNUgptln5bFSWnwMHAkhbKlor7a2bDPHcpO6Fiti5EubKodw3+1i0nZ
Lx5y3Jgr1ae41s/hAuxGF8MtfyBHmBhl5EkoVLnHKLE/mYmIg2C2v/TwN6xmwpuh
zXhIyon2Ht2p8pi0nI197Mp6av+Ify3/EC0UgfC+yyVHhTAugq9DIF833Y8zXrqR
VeWb6Kg0
=ay5H
-----END PGP SIGNATURE-----

Comment thread src/blockencodings.h Resolved
@dergoegge

Copy link
Copy Markdown
Member Author

@MarcoFalke addressed all your comments. CI failures seem unrelated (restarted the failing jobs).

@mzumsande mzumsande left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review ACK a1c3627

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Follow-ups can be done in new pulls, if there are any.

re-ACK a1c3627 🎼

Show signature

Signature:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

re-ACK a1c36275b5a27ae685f49ff02dabff0adbf51aa1  🎼
-----BEGIN PGP SIGNATURE-----

iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUhUGAv8CVgILyXBbe4tlLJ6RxNL9KDFKjr7dYR+6pLtarndtMPlJs+xS/dJwHSi
6Exkiq1N54HCLzzgMZeN03rUW4FbXW1qngFiTS4SJCOliuaqtZInk4uH8O5AIlWt
igJ8Kfeues7VcwsVSIIAkfg8ZCnoj4BoOKJGWNdRVeCUfa0JqoftIHzX3yqwjmS/
7Y9CWzn7nTqqSzcel4Ry6BcqMetJsZohTtsqy8GCZfB/Ylam5TxrUgkYaBid8BO+
4sTAcy9Cj9+2JhHXeyXXVaLbPDeB3WHErHelxv8z0PgKcH1xDvvVO7SmAuKWVP6q
Lsq6n+OannMTc8V24ue5x+QQTDtTLl33C+MNSZnCG7lZ0WPW2vmHZEvyGBTsLZId
TM3uVmByZlCjOHir4Vm9hR6DupzLkjNRaoKlLSeZrrvBJuEWQ2vMZGv+5OIyHVTE
GJHsVC7djHNX1yVtqT6j8jCgqigotS5piD3hcYB3z30nBfCa1lzaZpt1p9/TkSyD
4jM6fVom
=ozo3
-----END PGP SIGNATURE-----

BlockValidationResult::BLOCK_INVALID_PREV,
BlockValidationResult::BLOCK_TIME_FUTURE,
BlockValidationResult::BLOCK_CHECKPOINT,
BlockValidationResult::BLOCK_HEADER_LOW_WORK});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could move to a common header file?

@maflcko
maflcko merged commit 837e9ed into bitcoin:master Jan 24, 2023

@maflcko maflcko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left more nits 😅

pool.addUnchecked(ConsumeTxMemPoolEntry(fuzzed_data_provider, *tx));
available.insert(i);
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could make sense to include some extraneous txs that are not in the block in the extra txn or mempool?

Comment on lines +95 to +96
if (init_status == READ_STATUS_OK) {
assert(!pdb.IsTxAvailable(i) || available.count(i) > 0);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

        if (init_status == READ_STATUS_OK && pdb.IsTxAvailable(i)) {
            assert(available.count(i) > 0);

Also, in the comment replace "then" with "and"?

Comment on lines +100 to +104
if (!pdb.IsTxAvailable(i) && !skip) {
missing.push_back(block->vtx[i]);
}

skipped_missing |= (!pdb.IsTxAvailable(i) && skip);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

        if (!pdb.IsTxAvailable(i)) {
            if (skip) { skipped_missing = true; }
            else { missing.push_back(block->vtx[i]); }
        }

@bitcoin bitcoin locked and limited conversation to collaborators Jan 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants