Skip to content

test: add disallow_reorg_within_first_proposal_burn_block_timing_secs_but_more_than_one_block_scenario #6039

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

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

orsissimo
Copy link
Contributor

This PR adds a new SendAndMineTransferTx command to the signer test harness in madhouse/scenario style as continuation of #6007.

@orsissimo orsissimo changed the base branch from master to develop April 28, 2025 15:23
impl Command<SignerTestState, SignerTestContext> for SendAndMineTransferTx {
fn check(&self, _state: &SignerTestState) -> bool {
info!("Checking: SendAndMineTransferTx");
true
Copy link
Member

Choose a reason for hiding this comment

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

Should this command always run?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we'll need some advice from stacks-core integration testing ninjas to set this check up properly 🤔

Copy link
Contributor

@BowTiedRadone BowTiedRadone left a comment

Choose a reason for hiding this comment

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

Great first step! Left a couple suggestions. Keep it up 🚀

@BowTiedRadone
Copy link
Contributor

BowTiedRadone commented Apr 30, 2025

@orsissimo Just saw the latest commit. I’ll be able to review the new command later today. The first thing that comes to mind: can you please run cargo fmt-stacks to keep CI happy? I'll be back with a more detailed review. 🚀

@orsissimo
Copy link
Contributor Author

WaitForRejectedBlockProposal command is currently failing with
Test failed: Timed out waiting for block proposal: "Timed out".
There might be something I'm not addressing correctly, I'll be back on this command later today!

Copy link
Contributor

@BowTiedRadone BowTiedRadone left a comment

Choose a reason for hiding this comment

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

Great progress! Left some more comments 🚀

…ore_than_one_block_scenario() and new madhouse commands

Commands added:
SendAndMineTransferTx
BuildNextBitcoinBlock
WaitForAndVerifyBlockRejection
VerifyMiner1BlockCount
@orsissimo orsissimo force-pushed the test/disallow-reorg-scenario branch from 645731b to 150c833 Compare May 2, 2025 20:44
Copy link

codecov bot commented May 3, 2025

Codecov Report

Attention: Patch coverage is 1.35747% with 218 lines in your changes missing coverage. Please review.

Project coverage is 83.72%. Comparing base (dc5982c) to head (5790de2).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...tacks-node/src/tests/signer/commands/block_wait.rs 0.00% 129 Missing ⚠️
.../stacks-node/src/tests/signer/commands/transfer.rs 0.00% 41 Missing ⚠️
...cks-node/src/tests/signer/commands/block_commit.rs 3.57% 27 Missing ⚠️
testnet/stacks-node/src/tests/signer/v0.rs 8.69% 21 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6039      +/-   ##
===========================================
+ Coverage    83.39%   83.72%   +0.33%     
===========================================
  Files          538      538              
  Lines       387714   387932     +218     
  Branches       323      323              
===========================================
+ Hits        323321   324799    +1478     
+ Misses       64385    63125    -1260     
  Partials         8        8              
Files with missing lines Coverage Δ
...t/stacks-node/src/tests/signer/commands/context.rs 87.50% <ø> (ø)
testnet/stacks-node/src/tests/signer/v0.rs 57.25% <8.69%> (+9.30%) ⬆️
...cks-node/src/tests/signer/commands/block_commit.rs 33.75% <3.57%> (-16.25%) ⬇️
.../stacks-node/src/tests/signer/commands/transfer.rs 0.00% <0.00%> (ø)
...tacks-node/src/tests/signer/commands/block_wait.rs 38.57% <0.00%> (-61.43%) ⬇️

... and 45 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 4a7b908...5790de2. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@BowTiedRadone BowTiedRadone left a comment

Choose a reason for hiding this comment

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

Great work! I left some more comments/general suggestions. After they are addressed, I believe we are ready to take the PR out from draft. 🎸

pub struct VerifyMiner1BlockCount {
miners: Arc<Mutex<MultipleMinerTest>>,
expected_count: usize,
expected_block_count: usize,
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid this field that can affect the assertion, an idea off the top of my head would be to separate blocks_mined state field into two, one for each miner, or even a map with n keys for n miners. From there, the total could be calculated as:

let total_mined_blocks_count = blocks_mined_per_miner.values().fold(0, |acc, &count| acc + count);

By doing this, you can retrieve the miner 1 blocks directly in this command, and use it inside the assertion.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I love this approach!
This way we also keep track if each miner's activity

@@ -41,6 +41,21 @@ impl SignerTestContext {
miners: Arc::new(Mutex::new(miners)),
}
}

pub fn get_miner_skip_commit_flag(
Copy link
Contributor

Choose a reason for hiding this comment

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

🚀

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