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

Feat/nakamoto block push #4877

Merged
merged 23 commits into from
Jun 13, 2024
Merged

Feat/nakamoto block push #4877

merged 23 commits into from
Jun 13, 2024

Conversation

jcnelson
Copy link
Member

@jcnelson jcnelson commented Jun 6, 2024

This PR implements #3825 by expanding the relayer logic to both (1) push novel Nakamoto blocks to neighbors, and (2) buffer unsolicited Nakamoto blocks so they can be processed whenever their sortition arrives.

In addition, this PR does some housekeeping by:

  • Moving all unsolicited message handling into its own file (src/net/unsolicited.rs)
  • Moving all epoch 2.x relayer tests into its own module (src/net/tests/relay/epoch2x.rs)
  • Refactoring the relayer code to better separate epoch-specific block handling and relaying (src/net/relay.rs).

Most of the delta in this PR is just housekeeping -- i.e. moving code around and refactoring.

This is a draft for now because I'd like to add some more tests, but the unit tests that are present verify that unsolicited Nakamoto block buffering works, and verify that a follower node can boot up from blocks pushed to it by a seed node.

@saralab saralab requested review from kantai and obycode June 10, 2024 15:04
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

Mostly pretty light comments. There's a couple comments where the behavior seems like it could be off, and I'm a little worried about the block.clone() usage.

stackslib/src/net/mod.rs Show resolved Hide resolved
stackslib/src/net/p2p.rs Outdated Show resolved Hide resolved
stackslib/src/net/relay.rs Outdated Show resolved Hide resolved
stackslib/src/net/relay.rs Outdated Show resolved Hide resolved
stackslib/src/net/relay.rs Outdated Show resolved Hide resolved
stackslib/src/net/unsolicited.rs Show resolved Hide resolved
stackslib/src/net/unsolicited.rs Outdated Show resolved Hide resolved
stackslib/src/net/unsolicited.rs Show resolved Hide resolved
stackslib/src/net/unsolicited.rs Outdated Show resolved Hide resolved
stackslib/src/net/unsolicited.rs Outdated Show resolved Hide resolved
@jcnelson jcnelson marked this pull request as ready for review June 11, 2024 02:29
@jcnelson jcnelson requested a review from a team as a code owner June 11, 2024 02:29
kantai
kantai previously approved these changes Jun 12, 2024
obycode
obycode previously approved these changes Jun 12, 2024
Copy link
Contributor

@obycode obycode left a comment

Choose a reason for hiding this comment

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

lgtm!

Co-authored-by: Brice Dobry <[email protected]>
@jcnelson jcnelson dismissed stale reviews from obycode and kantai via 7b4578b June 12, 2024 20:37
@jcnelson jcnelson requested review from kantai and obycode June 12, 2024 20:37
@jcnelson
Copy link
Member Author

@obycode @kantai Thanks for your reviews! Just need re-approvals to correct a typo 🙏

@jcnelson jcnelson enabled auto-merge June 12, 2024 20:37
@jcnelson jcnelson added this pull request to the merge queue Jun 13, 2024
Merged via the queue into develop with commit 104b6db Jun 13, 2024
1 check passed
github-merge-queue bot pushed a commit that referenced this pull request Jul 3, 2024
…or-pr-4877

Add skip header for timeout mutants - pr #4877 related
@blockstack-devops
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@stacks-network stacks-network locked as resolved and limited conversation to collaborators Oct 30, 2024
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.

5 participants