-
Notifications
You must be signed in to change notification settings - Fork 66
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
Add for wind/unwind support to tbc #159
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
marcopeereboom
added
type: feature
This adds new functionality
size: XL
This change is very large (+/- <1000)
area: tbc
This is a change to TBC (Tiny Bitcoin)
labels
Jun 26, 2024
joshuasing
reviewed
Jun 26, 2024
… but should go in for backup
…he coinbase transaction
marcopeereboom
added
status: breaking
This is a breaking and non-backwards compatible change
size: XXL
This change is extremely large (+/- 1000+). Changes this large should be split into multiple PRs
and removed
size: XL
This change is very large (+/- <1000)
labels
Jul 22, 2024
joshuasing
reviewed
Jul 22, 2024
Co-authored-by: Joshua Sing <[email protected]>
joshuasing
approved these changes
Jul 22, 2024
ClaytonNorthey92
approved these changes
Jul 22, 2024
web3cryptoguy
pushed a commit
to web3cryptoguy/heminetwork
that referenced
this pull request
Nov 1, 2024
* Add function to determine canonical chain * Refactor tests to simplify calling code * Add name concept to block so that we can easily match blocks and geometry * Proper exit tests so that we can multiple fake nodes and tbc clients * Create odd geometries to hit corner cases * Detect direction * I think this fixes the unknown tip issue; code needs to be cleaned up but should go in for backup * Determine direction and call wind/unwind function * Flip direction logic around; while it was correct it was difficult to reason about * Add linear test * Add not linear error to check against * unindex transactions * cache parsed tx's in mined block for easy reference * Flesh out mustHave to check all cached tx's exist * ensure iterator does not step pout of bounds; it does :( * Fix silly reversals * Make this somewhat work * ugh go vet being dumb * Fixup names * Do not store coinbase in spent transaction cache * Bring back spent transaction cache test now that we no longer store the coinbase transaction * Collapse IsLinear function and add callers for the various indexers * Add utxo unwind * Attempt at utxo unwind * tbc: clean up unnecessary use of fmt.Errorf * XXX * maybe fix utxo unwind * try to spend some coinbase tx' * oops add new tx to mempool * rebase main fallout * Add a seperate tx signing test so that we can make this into a function that can be called from various spots in the code; this is too brittle to embed * Remove cruft * tbc: value of direction is never used (SA4006) * tbc: add missing err check in TestBlockHeaderEncodeDecode * tbc: replace loop with peers = append(peers, moreSeeds...) (S1011) * tbc: remove unused (*Server).blocksMissing function * tbcd/level: remove unused bytes2Block function * tbcd/level: remove unused bytes2Header function * tbcd/level: fix types being nested in one type block * Create generic transaction from another transaction lots of help max * Oops, print hex for scripthash * Add a non forking test * Working unwind!!! help from max and joshua * Make a note that genesis does not produce a spent output * mostly working forking unwind tests * Keep track of balances * disable broken balnce checks * Note a bug in unwinding utxos * Note an odd bug * wait for server to shut down * wait for port to be open * do not error if context is canceled * do not panic on cancel * tbc: handle err returned by btcutil.NewAddressPubKeyHash in test * tbc: use errors.New when formatting is not needed * tbc: improve some spacing, code flow and readability * tbc: attempt to improve impossible case for direction in TxIndexer * tbc: remove unnecessary space before : in errors * tbc: attempt to improve impossible case for direction in UtxoIndexer * large wtf * Fix off by one * remove wait groups, add listener.close, more timing for mine and send * add longer timing * The big Spend->Spent rename * Fix hemictl help * Bunch of cleanup * more fixes * Couple more fixes, lot's of help joshuasing * Update database/tbcd/database.go Co-authored-by: Joshua Sing <[email protected]> --------- Co-authored-by: Joshua Sing <[email protected]> Co-authored-by: ClaytonNorthey92 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: hemictl
This is a change to hemictl
area: tbc
This is a change to TBC (Tiny Bitcoin)
size: XXL
This change is extremely large (+/- 1000+). Changes this large should be split into multiple PRs
status: breaking
This is a breaking and non-backwards compatible change
type: feature
This adds new functionality
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for detecting canonical chain and unwinding of indexes during reorgs.
Changes