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

feat: enable testnet4 support in the bitcoin adapter #3267

Open
wants to merge 12 commits into
base: mihailjianu1/bitcoin-crate-upgrade
Choose a base branch
from

Conversation

mihailjianu1
Copy link
Contributor

@mihailjianu1 mihailjianu1 commented Dec 19, 2024

This involved:

  • changing the seeds,
  • upgrading the bitcoin crate (see base branch)
  • finally, fixing a bug in the header validation, a fix which is required in the bitcoin canister too (and even on the bitcoin crate if we want to use their helpers): For testnet networks, the difficulty temporarily drops to the minimum if no block has been found in 20 minutes. Block 30239 is an example of such block, and it (coincidentally) occurs right before a "difficulty change", once every 2016 blocks. With the previous implementation, this leads to the difficulty to be dropped massively (to the minimum) on the next difficulty batch, because the difficulty of an "epoch" block (in this case block 30240) depends directly on its previous block (block 30239, which had the "temporarily" drop in difficulty). The fix involved making the new difficulty depend on the difficulty of the previous "epoch block", which does not have a drop in difficulty.

@github-actions github-actions bot added the feat label Dec 19, 2024
@mihailjianu1 mihailjianu1 changed the base branch from master to mihailjianu1/bitcoin-crate-upgrade December 19, 2024 15:17
@mihailjianu1 mihailjianu1 marked this pull request as ready for review December 19, 2024 15:30
@mihailjianu1 mihailjianu1 requested review from a team as code owners December 19, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants