Skip to content

fuzz: increase txorphan harness stability - #30186

Merged
fanquake merged 2 commits into
bitcoin:masterfrom
marcofleon:2024/05/txorphan-harness-instability
Jun 3, 2024
Merged

fanquake merged 2 commits into
bitcoin:masterfrom
marcofleon:2024/05/txorphan-harness-instability

Conversation

@marcofleon

@marcofleon marcofleon commented May 28, 2024 •

Copy link
Copy Markdown
Contributor

This moves nNextSweep from being a static variable in LimitOrphans to being a member of the TxOrphanage class. This improves the stability of the txorphan fuzz harness, as each orphanage (created every iteration) now has its own value for nNextSweep.

@DrahtBot

DrahtBot commented May 28, 2024 •

Copy link
Copy Markdown
Contributor

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

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK dergoegge, maflcko, glozow

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #30111 (locks: introduce mutex for tx download, flush rejection filters on UpdatedBlockTip by glozow)
  • #30110 (refactor: TxDownloadManager by glozow)
  • #29641 (scripted-diff: Use LogInfo/LogDebug over LogPrintf/LogPrint by maflcko)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@DrahtBot DrahtBot added the Tests label May 28, 2024

@dergoegge dergoegge 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.

I suspect that the scripted diff is failing in CI but passing on your Mac because sed behaves differently on Mac vs Linux. Maybe this helps?

Comment thread src/txorphanage.h Resolved
@maflcko

maflcko commented May 28, 2024

Copy link
Copy Markdown
Member

but passing on your Mac

The script shouldn't be passing on macos. Otherwise, b3122e1 doesn't work as intended and should be fixed.

@marcofleon
marcofleon force-pushed the 2024/05/txorphan-harness-instability branch 2 times, most recently from f2f9610 to 94a30f1 Compare May 28, 2024 23:33
@marcofleon

Copy link
Copy Markdown
Contributor Author

Seems like CI still doesn't like it.

I tried this (no space after -i)
sed -i'' 's/nNextSweep/m_next_sweep/g' $(git grep -l 'nNextSweep')

and it didn't work on Mac. Adding the -e without .bak creates new txorphanage files with -e appended to the end of them. Something like txorphanage.h-e. Adding .bak prevented that but CI isn't accepting it.

@maflcko

maflcko commented May 29, 2024

Copy link
Copy Markdown
Member

and it didn't work on Mac.

You'll have to install and use gnu-sed on macos, or use Linux. If you don't want to test locally and want to know the syntax without testing, you can look at previous examples via git log --grep='sed -i'.

Though, I am not sure if a three line diff is worth a scripted diff, so an alternative would be to just squash everything down into a single commit.

Comment thread src/txorphanage.h Resolved
@dergoegge

Copy link
Copy Markdown
Member

I am not sure if a three line diff is worth a scripted diff

Just for context, I suggested it to marco as a learning exercise.

@maflcko

maflcko commented May 29, 2024

Copy link
Copy Markdown
Member

Sure, sounds good either way. Happy to review once CI is green and the UB is removed.

-BEGIN VERIFY SCRIPT-
sed -i 's/nNextSweep/m_next_sweep/g' $(git grep -l 'nNextSweep')
-END VERIFY SCRIPT-

fixing to match style
@marcofleon
marcofleon force-pushed the 2024/05/txorphan-harness-instability branch from 17d94a1 to 8defc18 Compare May 29, 2024 16:04
@marcofleon
marcofleon marked this pull request as ready for review May 29, 2024 16:05
@marcofleon

Copy link
Copy Markdown
Contributor Author

You'll have to install and use gnu-sed on macos, or use Linux. If you don't want to test locally and want to know the syntax without testing, you can look at previous examples via git log --grep='sed -i'.

I installed gnu-sed and used that locally. CI looks good now.

@dergoegge dergoegge 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.

Code review ACK 8defc18

@maflcko

maflcko commented May 30, 2024

Copy link
Copy Markdown
Member

utACK 8defc18

@maflcko

maflcko commented May 30, 2024

Copy link
Copy Markdown
Member

cc @glozow This conflicts with some of your pulls, so maybe you can have a look here? (#30186 (comment))

@glozow glozow 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.

utACK 8defc18, I can rebase on this pretty easily

@fanquake
fanquake merged commit e18accc into bitcoin:master Jun 3, 2024
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jul 19, 2024
Summary:
Backport of [[bitcoin/bitcoin#30186 | core#30186]] and [[bitcoin/bitcoin#30306 | core#30306]].

Note that we don't have the fuzz test yet, the point is to get the module up-to-date with upstream.

Depends on D16505.

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16507
roqqit pushed a commit to doged-io/doged that referenced this pull request Aug 1, 2024
Summary:
Backport of [[bitcoin/bitcoin#30186 | core#30186]] and [[bitcoin/bitcoin#30306 | core#30306]].

Note that we don't have the fuzz test yet, the point is to get the module up-to-date with upstream.

Depends on D16505.

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16507
@marcofleon
marcofleon deleted the 2024/05/txorphan-harness-instability branch November 19, 2024 18:44
@bitcoin bitcoin locked and limited conversation to collaborators Nov 19, 2025
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.

6 participants