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

fix: disregard tx count if the stacks tip has changed #5158

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

obycode
Copy link
Contributor

@obycode obycode commented Sep 10, 2024

When mining, if the Stacks tip changes, then we no longer want to compare the transaction count of a newly mined block with that of the previously mined block, since the previous block is now a reorg.

Fixes #5157.

@obycode obycode requested a review from a team as a code owner September 10, 2024 18:02
@obycode
Copy link
Contributor Author

obycode commented Sep 10, 2024

This still needs an integration test.

@hstove
Copy link
Contributor

hstove commented Sep 15, 2024

Plan for integration test:

  • Two miners
  • Miner A finishes a tenure and miner B submits a block commit before seeing the last block of A's tenure
  • B's commit is committing to a block (of A's) that has something like 4 tx's
  • Then, B gets the new block from A and builds off of it
  • When B tries to make a block, it only has two tx's available, because 2 of them were in A's last block
  • Without this PR's change, the miner would get stuck. The test should verify that B can make the new block just fine

@obycode
Copy link
Contributor Author

obycode commented Sep 15, 2024

Plan for integration test:

  • Two miners
  • Miner A finishes a tenure and miner B submits a block commit before seeing the last block of A's tenure
  • B's commit is committing to a block (of A's) that has something like 4 tx's
  • Then, B gets the new block from A and builds off of it
  • When B tries to make a block, it only has two tx's available, because 2 of them were in A's last block
  • Without this PR's change, the miner would get stuck. The test should verify that B can make the new block just fine

This sounds good, except in the last bullet, it's not that the miner would get stuck, but it would mine a sibling block, instead of building off of the latest tip, so we would not see the chain length increase and we would see two blocks at the same height.

@saralab saralab added this pull request to the merge queue Sep 16, 2024
Merged via the queue into develop with commit 1a87f5b Sep 16, 2024
1 check 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 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants