Skip to content

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Jun 30, 2021

The code is complicated and confusing. Now that it is unused, remove it to avoid the risk of using it later.

@fanquake fanquake added the P2P label Jun 30, 2021
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

ACK fa0dff5 code review, debug-built and tested after rebasing to master, ran unit tests and sub_net_deserialize fuzzer briefly

$ FUZZ=sub_net_deserialize src/test/fuzz/fuzz ../qa-assets/fuzz_seed_corpus/sub_net_deserialize
.../...
#103509	REDUCE cov: 352 ft: 544 corp: 51/1064b lim: 932 exec/s: 7393 rss: 205Mb L: 20/129 MS: 2 ShuffleBytes-EraseBytes-
#131072	pulse  cov: 352 ft: 544 corp: 51/1064b lim: 1201 exec/s: 7710 rss: 224Mb
#150330	REDUCE cov: 352 ft: 544 corp: 51/1063b lim: 1391 exec/s: 7516 rss: 237Mb L: 6/129 MS: 1 EraseBytes-
#185891	REDUCE cov: 353 ft: 546 corp: 52/1085b lim: 1741 exec/s: 7745 rss: 261Mb L: 22/129 MS: 1 CMP- DE: "\xfd\x87\xd8~\xebC"-
#262144	pulse  cov: 353 ft: 546 corp: 52/1085b lim: 2491 exec/s: 7710 rss: 313Mb
#524288	pulse  cov: 353 ft: 546 corp: 52/1085b lim: 5105 exec/s: 8322 rss: 489Mb
#1048576 pulse  cov: 353 ft: 546 corp: 52/1085b lim: 10320 exec/s: 8192 rss: 522Mb

@practicalswift
Copy link
Contributor

Concept ACK

Unused code should be removed.

Copy link
Contributor

@theStack theStack left a comment

Choose a reason for hiding this comment

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

Code-review ACK fa0dff5

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 27, 2021

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

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.

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 fa0dff5

Comment on lines +147 to +154
try {
{
int version;
ds >> version;
ds.SetVersion(version);
}
ds >> CSubNet{};
} catch (const std::ios_base::failure&) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: why the extra {}?

Copy link
Member Author

Choose a reason for hiding this comment

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

to limit the scope of version and to put it in its own section. An alternative would be add a newline after ds.SetVersion and not care about the scope.

@vasild
Copy link
Contributor

vasild commented Jul 28, 2021

The Unserialize() method can be removed once we stop reading banlist.dat, in the next version, I guess... Actually, given that 22.0 is branched of and this change, after being merged to master, will only be released in 23.0, wouldn't it be easier to drop Serialize(), Unserialize() and banlist.dat reading support now?

@maflcko
Copy link
Member Author

maflcko commented Jul 28, 2021

Done in #22570

@DrahtBot DrahtBot mentioned this pull request Jul 29, 2021
@laanwj
Copy link
Member

laanwj commented Aug 1, 2021

Concept ACK (as it doesn't get rid of a lot of code like this, I have a slight preference for removing the serialization and deserialization code at the same time, but no opposition to doing it like this either)

@maflcko
Copy link
Member Author

maflcko commented Aug 1, 2021

Indeed.

Please review (ACK/NACK) #22570 first.

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 2, 2021

🐙 This pull request conflicts with the target branch and needs rebase.

Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".

@maflcko maflcko closed this Aug 2, 2021
@maflcko maflcko deleted the 2106-serSubNo branch August 2, 2021 11:44
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants