Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Mar 20, 2021

This has minimally better performance. Reported by me in #20228 (comment)

@fanquake fanquake added the Tests label Mar 20, 2021
@maflcko
Copy link
Member Author

maflcko commented Mar 20, 2021

I am also thinking about renaming this to ConsumeEnumFlags to better reflect what it does, but maybe this can be done later or the existing name is fine already?

@practicalswift
Copy link
Contributor

Concept ACK on both using ConsumeWeakEnum and renaming it ConsumeEnumFlags.

Better naming will be helpful for future generations of Bitcoin Core fuzzing enthusiasts, and ConsumeEnumFlags sure is a better name :)

@practicalswift
Copy link
Contributor

Tested ACK 5555446

Copy link
Contributor

@vasild vasild left a comment

Choose a reason for hiding this comment

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

ACK 5555446

I think the existent name "...weak...()" is good because the function may return a completely arbitrary value that is not in the enum. ConsumeEnumFlags() may give the wrong impression that it only returns enumerated values.

@maflcko
Copy link
Member Author

maflcko commented Mar 21, 2021

Though, "weak" could also be interpreted as "weakly typed enum", meaning a non-C++11-"strongly typed enum". But this interpretation would be wrong because flags can also be implemented with strongly typed enums. Maybe there is a better name that we haven't yet thought of?

@maflcko maflcko merged commit d400e67 into bitcoin:master Mar 23, 2021
@maflcko maflcko deleted the 2103-fuzzEnumWeak branch March 23, 2021 08:46
@maflcko
Copy link
Member Author

maflcko commented Mar 23, 2021

On really verbose name could be ConsumeUnderlyingTypeEnum?

@maflcko
Copy link
Member Author

maflcko commented Mar 23, 2021

[09:35] <vasild> MarcoFalke: maybe ConsumeEnumOrRandom() better describes it?

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Mar 23, 2021
… flags

5555446 fuzz: Use ConsumeWeakEnum in addrman for service flags (MarcoFalke)

Pull request description:

  This has minimally better performance. Reported by me in bitcoin#20228 (comment)

ACKs for top commit:
  practicalswift:
    Tested ACK 5555446
  vasild:
    ACK 5555446

Tree-SHA512: 4e5f51fe4f2bd7b2f37d0690e41203341ba45c0c9bc9247449cd26cfb5f77dc2ec61df3e4963276f68694e4b3ca3d0a76367a51c4d775501edeb3224d305a261
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 16, 2022
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.

4 participants