Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Decouple peer-processing from block-connection logic #1866

Merged
merged 14 commits into from
Sep 26, 2020

Conversation

random-zebra
Copy link

Backports bitcoin#8865 and bitcoin#8969, in preparation for the long-awaited net_processing/validation split.

@furszy
Copy link

furszy commented Sep 24, 2020

whoop whoop!, nice work 😄 . Obvious concept ACK, damn that took a while to get to this point but we are finally here.

@furszy
Copy link

furszy commented Sep 24, 2020

check travis macOS job, seems to be failing due a recursive mutex lock.

TheBlueMatt and others added 14 commits September 24, 2020 16:51
In anticipation of making all the callbacks out of block processing
flow through it. Note that vHashes will always have something in it
since pindexFork != pindexNewTip.
>>> based on bitcoin/bitcoin@fef1010

This adds a new CValidationInterface subclass, defined in main.h,
to receive notifications of UpdatedBlockTip and use that to push
blocks to peers, instead of doing it directly from
ActivateBestChain.
UnloadBlockIndex is only used during init if we end up reindexing
to clear our block state so that we can start over. However, at
that time no connections have been brought up as CConnman hasn't
been started yet, so all of the network processing state logic is
empty when its called.

Additionally, the initialization of the recentRejects set is moved
to InitPeerLogic.
@random-zebra
Copy link
Author

Yep. fixed.

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

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

ACK 94cc49f

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

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

Looking good, ACK 94cc49f and merging..

perpetual updating PIVX Core to BTC Core automation moved this from In Progress to Ready Sep 26, 2020
@furszy furszy merged commit 585c9fe into PIVX-Project:master Sep 26, 2020
perpetual updating PIVX Core to BTC Core automation moved this from Ready to Done Sep 26, 2020
furszy added a commit that referenced this pull request Sep 30, 2020
…main.{h,cpp})

34ad9d5 [Cleanup] Fix cs_main in net_processing (random-zebra)
f798b5f Rename the remaining main.{h,cpp} to validation.{h,cpp} (random-zebra)
be294cb [Validation] Move Block spam filter to net_processing (random-zebra)
520ae4b Move network-msg-processing code out of main to its own file (random-zebra)
9b894ed [Validation] save mapBlockSource in ProcessMessage (not ProcessNewBlock) (random-zebra)
2f37add Remove orphan state wipe from UnloadBlockIndex. (Matt Corallo)

Pull request description:

  Finally split main.{h,cpp} file in net_processing.{h,cpp}/validation.{h,cpp} as per upstream (bitcoin#9260) 🎉

  Built on top of
  - [x] #1866

ACKs for top commit:
  Fuzzbawls:
    ACK 34ad9d5
  furszy:
    ACK 34ad9d5 with a minor nit.

Tree-SHA512: 18b1457759d8684344c271236c63e1d9c83ed6e651da3efd2a7d8ab5af577fdfa85fd0f08107a26f952c3ae5da0793ebb77a2c5a710c65161f5132178db931e3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

4 participants