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

test: Timing of Nakamoto miner block production #4823

Merged
merged 2 commits into from
May 30, 2024

Conversation

jbencin
Copy link
Contributor

@jbencin jbencin commented May 24, 2024

Description

This PR changes the default value for nakamoto_attempt_time_ms to 20 seconds and adds an integration test, test_nakamoto_attempt_time, to check that this value works as expected. Specifically, it checks the following:

  • No blocks are produced if no transactions are submitted
  • If there is a small number of transactions, blocks will be produced at the rate of nakamoto_attempt_time_ms
  • If there are many transactions in the mempool, where it would take longer than nakamoto_attempt_time_ms to include them all in a single block, blocks will still be produced at the rate of nakamoto_attempt_time_ms

Applicable issues

Additional info (benefits, drawbacks, caveats)

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo
  • New integration test(s) added to bitcoin-tests.yml

@jbencin jbencin requested review from a team as code owners May 24, 2024 20:23
Copy link

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 0.38760% with 257 lines in your changes are missing coverage. Please review.

Project coverage is 80.81%. Comparing base (3985c20) to head (4804c17).
Report is 1 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #4823       +/-   ##
============================================
+ Coverage    21.46%   80.81%   +59.35%     
============================================
  Files          476      481        +5     
  Lines       343843   345369     +1526     
  Branches         0      323      +323     
============================================
+ Hits         73796   279121   +205325     
+ Misses      270047    66240   -203807     
- Partials         0        8        +8     
Files Coverage Δ
testnet/stacks-node/src/config.rs 64.58% <100.00%> (+18.99%) ⬆️
...net/stacks-node/src/tests/nakamoto_integrations.rs 6.26% <0.00%> (-0.50%) ⬇️

... and 427 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 969f4a2...4804c17. Read the comment docs.

@saralab saralab requested review from kantai and obycode May 28, 2024 13:53
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.

Can you add this test to .github/workflows/bitcoin-tests.yml?

@jbencin jbencin force-pushed the test/nakamoto-block-timing branch from bce277f to 4804c17 Compare May 29, 2024 15:03
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.

This looks good to me!

@saralab saralab added this pull request to the merge queue May 30, 2024
Merged via the queue into stacks-network:develop with commit 51f51a5 May 30, 2024
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 Oct 31, 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