Skip to content

Conversation

jferrant
Copy link
Contributor

@jferrant jferrant commented Oct 9, 2025

Closes #6564

The main problem was actually the missing call to

     stacks_node.add_nakamoto_extended_blocks(vec![nakamoto_block]);

which was causing each tenure epoch to reorg the prior block. With that fixed, the tests need to correctly increment the nonce and don't allow redeploy of the same contract name, etc. as expected.

However, after talking with @kantai, we determined that it would be better to directly test NakamotoChainState::process_next_nakamoto_block instead of append_block. This not only handles the clarity_commit, chainstate_tx, etc. correctly, but its the actual point of entry to the append_block call (it also does some preliminary static checks). However, to use this function, I needed to determine the path of entry into the staging blocks db...I am fairly confident accept_block is the only access (beyond an explicit call to add_shadow_block). See #6585 for confirmation.

@jferrant jferrant requested review from Jiloc, fdefelici and kantai October 9, 2025 17:25
@jferrant jferrant requested review from a team as code owners October 9, 2025 17:25
@jferrant jferrant force-pushed the bug/fix-consensus-test-canonical-tip branch 2 times, most recently from 5ef0407 to 9b550b4 Compare October 9, 2025 17:57
@jferrant jferrant force-pushed the bug/fix-consensus-test-canonical-tip branch from 9b550b4 to e7340e8 Compare October 9, 2025 17:57
Copy link
Contributor

@fdefelici fdefelici left a comment

Choose a reason for hiding this comment

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

LGMT!

Copy link
Contributor

@Jiloc Jiloc left a comment

Choose a reason for hiding this comment

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

LGTM!

@jferrant jferrant added this pull request to the merge queue Oct 10, 2025
Merged via the queue into stacks-network:develop with commit 4c652ad Oct 10, 2025
298 of 303 checks passed
@jferrant jferrant deleted the bug/fix-consensus-test-canonical-tip branch October 10, 2025 14:03
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