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

change paradigm from checking for missing childrent to keeping track of tip via electrs #369

Closed
wants to merge 2 commits into from

Conversation

ClaytonNorthey92
Copy link
Contributor

@ClaytonNorthey92 ClaytonNorthey92 commented Jan 14, 2025

Summary

prior, to solve for forks we would try to fill in "missing children". the way we (I) had written it, there is no way to guarantee that we will get to the tip; if there were siblings at that height then we would not check for missing blocks.

a better way to do it it to check for the tip of the btc chain to change; when that changes, update the btc chain until we get to a known block

Changes
rather than walking up the btc chain, monitor the tip and walk down until we come across a known block

fixes #370

…of tip via electrs

prior, to solve for forks we would try to fill in "missing children".  the way we (I) had written it, there is no way to guarantee that we will get to the tip; if there were siblings at that height then we would not check for missing blocks.

a better way to do it it to check for the tip of the btc chain to change; when that changes, update the btc chain until we get to a known block
@ClaytonNorthey92 ClaytonNorthey92 requested a review from a team as a code owner January 14, 2025 02:55
@github-actions github-actions bot added the area: bfg This is a change to BFG (Bitcoin Finality Governor) label Jan 14, 2025
@ClaytonNorthey92
Copy link
Contributor Author

this is failing a localnet test, I will dive deeper in the AM

@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as draft January 14, 2025 03:37
@github-actions github-actions bot added the area: ci This is a change to CI files. Excluded from changelog label Jan 14, 2025
updating height cache
@ClaytonNorthey92
Copy link
Contributor Author

@ClaytonNorthey92 ClaytonNorthey92 marked this pull request as ready for review January 14, 2025 06:16

log.Tracef("checking for missing blocks, walking from tip %d to %d or first known block from tip", height, s.cfg.BTCStartHeight)

for height > s.cfg.BTCStartHeight {
Copy link
Contributor Author

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
area: bfg This is a change to BFG (Bitcoin Finality Governor) area: ci This is a change to CI files. Excluded from changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BFG incorrect fork handling
1 participant