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

Tighten up P2P relay and orphan management in order to perfect high-BPS block exchange #359

Merged
merged 16 commits into from
Dec 19, 2023

Conversation

michaelsutton
Copy link
Contributor

@michaelsutton michaelsutton commented Dec 15, 2023

Includes 3 major components which can be reviewed separately:

  1. Complete a full "revalidate orphans" algorithm including unorphaning (to be run post IBD)
  2. Close the sync gap between consensus and the block orphan pool leading to stuck orphans
  3. Add an IBD-related heuristic for deciding if to keep orphans

The end result tested via an internal TN11 testnet shows that with all the above, on-going P2P block exchange is smooth also on a 10BPS network and between peers with RTT > block time (=100ms)

@michaelsutton michaelsutton marked this pull request as ready for review December 15, 2023 09:43
Copy link
Collaborator

@coderofstuff coderofstuff left a comment

Choose a reason for hiding this comment

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

Looks sound logic-wise. Comments primarily for readability.

Copy link
Collaborator

@coderofstuff coderofstuff left a comment

Choose a reason for hiding this comment

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

Previous review had misaligned suggestions. Deleted those and put this one up.

@michaelsutton michaelsutton changed the title Implement revalidate orphans correctly Tighten up P2P relay and orphan management in order to perfect high-BPS block exchange Dec 18, 2023
Copy link
Collaborator

@coderofstuff coderofstuff left a comment

Choose a reason for hiding this comment

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

tested extensively on a slow laptop and I don't observe the repetitive IBD loop. IBD still happens after some time, but only on my very slow machine. The faster desktop is able to keep up without further IBD after the first.

@michaelsutton michaelsutton merged commit dc9adc7 into kaspanet:master Dec 19, 2023
6 checks passed
smartgoo pushed a commit to smartgoo/rusty-kaspa that referenced this pull request Jun 18, 2024
…PS block exchange (kaspanet#359)

* complete revalidate orphans correctly

* improve test

* names and comments

* close the sync gap between consensus and the block orphan pool

* renames and comments

* orphan ibd heuristic

* explain the ibd heuristic

* simplify orphan output case + review comments

* remove todo and explain why

* log orphan-related events via the event logger

* add nodnsseed cmd flag which disable DNS seeding for peers

* bump version to 0.13.1

* updated sync gap comment

* update fn doc

* typo

* fix logs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants