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

Nakamoto-Node: Support for interim block mining #4187

Merged
merged 4 commits into from
Dec 19, 2023
Merged

Conversation

kantai
Copy link
Member

@kantai kantai commented Dec 18, 2023

Description

This PR adds support to the nakamoto node for interim block mining (i.e., blocks within the current tenure) with a configurable wait time between such blocks. This PR also refactors the chainstate::nakamoto::miner module to match the actual usage of the miner interfaces, and moving the TestPeer specific method out into TestPeer itself.

This adds a new nakamoto_integration test which mines 10 nakamoto tenures, each with 2 blocks in the tenure.

@kantai kantai requested review from jcnelson and jferrant December 18, 2023 22:02
Copy link

codecov bot commented Dec 18, 2023

Codecov Report

Attention: 34 lines in your changes are missing coverage. Please review.

Comparison is base (8cffc38) 85.08% compared to head (3cef3b4) 65.52%.

Files Patch % Lines
stackslib/src/chainstate/nakamoto/tests/node.rs 71.18% 17 Missing ⚠️
testnet/stacks-node/src/nakamoto_node/miner.rs 80.59% 13 Missing ⚠️
stackslib/src/chainstate/nakamoto/miner.rs 95.91% 2 Missing ⚠️
...net/stacks-node/src/tests/nakamoto_integrations.rs 98.67% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             next    #4187       +/-   ##
===========================================
- Coverage   85.08%   65.52%   -19.57%     
===========================================
  Files         429      429               
  Lines      302009   302067       +58     
===========================================
- Hits       256976   197933    -59043     
- Misses      45033   104134    +59101     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

LGTM, provided that all tests pass. Thanks for the NakamotoBlockBuilder cleanup!

@kantai
Copy link
Member Author

kantai commented Dec 19, 2023

The code coverage drop seems to be due to tests which aren't run on PRs, but are run on the base branch (e.g., the epoch tests). The patch coverage is 90%.

…check to stackslib::miner assembly.

chore: fix typo
@kantai kantai force-pushed the feat/interim-mining branch from 24a4cda to 3cef3b4 Compare December 19, 2023 17:33
@kantai kantai merged commit 2789b18 into next Dec 19, 2023
1 of 2 checks passed
@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 Nov 7, 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.

4 participants