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

[Experimental] ci test: sync w bitcoin core #759

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Apr 28, 2019

I'm currently working on #721 which requires upgrades to the on-the-wire protocol, and I need to make sure I stay in sync (and not get banned) from bitcoind nodes.

This PR is an attempt to integrate bitcoind compatibility into our CI pull-testing.

I made a series of scripts that connect any number of bcoin and bitcoind nodes and uses RPC commands to test headers-first sync (work-in-progress): https://github.com/pinheadmz/networktest. I copied one of those tests into this PR, which syncs bcoin and bitcoind, then triggers a reorg from bitcoind by invalidating a block and building a new chain from there. For now, I've left on all the logging output and you can see its output in the testing report.

For local testing, a new command is added to package.json. For CI testing, the config.yaml has been updated to actually install bitcoind, and run an extra set of tests that connect it to bcoin.

To test the CircleCI changes locally, you can install the circleCI CLI tool and run the command:
circleci local execute --job install
Unfortunately the local CI tool doesn't manage workflows like the online CI tester, so one command must be uncommented to work locally. (see the comments in .circleci/config.yml )

Testing API changes

Not Affected

npm run test
npm run test-file

Added

npm run bitcoind-test
(only runs tests in /test/bitcoind-sync/*-test.js which require bitcoind to be installed and available as a command)

Modified

npm run test-ci
(adds all files in /test/bitcoind-sync/*-test.js to "test" job, included in codecov)

@codecov-io
Copy link

codecov-io commented Apr 28, 2019

Codecov Report

Merging #759 into master will increase coverage by 5.1%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #759     +/-   ##
=========================================
+ Coverage   56.64%   61.74%   +5.1%     
=========================================
  Files         112      112             
  Lines       28140    28140             
  Branches     4800     4800             
=========================================
+ Hits        15939    17376   +1437     
+ Misses      12201    10764   -1437
Impacted Files Coverage Δ
lib/mempool/fees.js 52.5% <0%> (-8.84%) ⬇️
lib/script/script.js 78.36% <0%> (+0.42%) ⬆️
lib/node/http.js 48.49% <0%> (+0.5%) ⬆️
lib/script/opcode.js 78.59% <0%> (+0.66%) ⬆️
lib/net/bip152.js 78.38% <0%> (+0.86%) ⬆️
lib/blockstore/file.js 99.56% <0%> (+0.87%) ⬆️
lib/blockchain/chaindb.js 58.51% <0%> (+1.3%) ⬆️
lib/node/rpc.js 27.71% <0%> (+1.45%) ⬆️
lib/node/fullnode.js 60.24% <0%> (+2.4%) ⬆️
lib/node/node.js 69.18% <0%> (+4.06%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d601b6a...1a91a55. Read the comment docs.

@braydonf
Copy link
Contributor

This is similar to https://cdecker.github.io/lightning-integration/ and could include btcd as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants