-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add testing framework * Somewhat working chain * Code is not ready to remove threading * Implent get data * be a bit less verbose * Use normal cache element count * And have a pass condition * check balance * go vet * go mod tidy * no ulimit check during tests * Push before rebase * Fix possible race conditions in tbcfork_test * Tidy up parts of tbcfork_test * Add forking support fake btc server * create for and advance both heads * We need to start panicing on fork situations * add some comments to mark special spots * added test case configuration for bitcoind inclusion in tests * add comment * removed unused val * Encode/decode difficulty in blockheader * imperitive forking in tests * no syncBlocks anymore since we generate them with current timestamps * comment out likely unused test * tbc: fix loop unconditionally exited after one interation (SA4004) * Add panic to catch unsupported fork * removed unused test data * fixup rebase drama, need to reenable TestLevelDB * tbc: use time.Since instead of time.Now().Sub (S1012) * finish fork scenario 1 * added more test cases * NewBuffer works in surprising ways * Detect forks when downloading block headers * XXX * deal with extending forks * First attempt at making BlockHeadersBest singular * tbcapi: update for BlockHeadersBest -> BlockHeaderBest * Add type to detect how block headers were inserted * Reap peers if not synced or sending crap block headers * Simplify and return hint to caller how to handle forks; caller now also resumes fork and chain extensions (in case fork id deep) * Remove debug panic and annotate code * Moar testing * tbcd: fix unnecessary use of fmt.Sprintf (S1039) * Yay working forks * tbcd: fix only first constant having explicit type (SA9004) * tbcd/level: use element from range, fix empty if statement * lower limits because latest ubuntu update * be less loud * skip test that causes an issue due to port bindings * Remove cached last block header * skipping balance tests for forking * tbc: BlockHeadersBest -> BlockHeaderBest in rpc_test * tbcapi: best block headers -> best block header * Work around most fork situations * mostly working but ugly interleaved start/stop downloading/indexing * Make peers wanted a setting and abort indexing a bit earlier * Ok this seems to work * remove clipped for now and only index if enabled * Fix broken test * Make fork choices more explicit and rename BlockHeaderInsert -> BlockHeaderGenesisInsert * make PeersWanted a runtime setting * Return canonical and last inserted block header in BlockHeaderInsert to pretty print and keep things sane * Rename 'last' to canonical/best * remove unused h2b80 function * Remove unused headerTime headerHash functions * Remove unsued structure blockPeer * Test err and use Error instead of Fatal * Remove unused function getEndpointWithRetries * Remove unused function submitBlock * Unexport map with fork type names * deleted unused test variable, increased for loop time sleep * Update database/tbcd/database.go Co-authored-by: Joshua Sing <joshua@bloq.com> * Update database/tbcd/database.go Co-authored-by: Joshua Sing <joshua@bloq.com> * Make Infof into debugf * Remove loud infof * Move loud fork proclamation to debugf * Remove leftover debug * Update service/tbc/tbc_test.go Co-authored-by: Joshua Sing <joshua@bloq.com> * tbc: nest short err assignments * tbcd/level: nest short err assignments * tbc: use errors.Is for error comparison * tbc/crawler: nest short err assignments * tbcd/level: deduplicate cbh/lbh assignment --------- Co-authored-by: ClaytonNorthey92 <clayton.northey@gmail.com> Co-authored-by: Joshua Sing <joshua@bloq.com>
- Loading branch information
1 parent
bbeed8b
commit 41a0009
Showing
15 changed files
with
2,269 additions
and
726 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.