keep-network / tbtc-dapp

Deposit BTC and redeem TBTC
http://dapp.test.tbtc.network/
MIT License
33 stars 31 forks source link

Investigate electrum server stability #113

Open nkuba opened 5 years ago

nkuba commented 5 years ago

It happens that CI tests are failing, e.g. https://circleci.com/gh/keep-network/tbtc-dapp/878

  1) BitcoinSPV
       getTransactionProof:
     Error: failed to get merkle proof: [Error: failed to get transaction merkle: [tx 72e7fd57c2adb1ed2305c4247486ff79aec363296f02ec65be141904f80d214e not in block at height 1,569,341]]
      at merkleProof.client.getMerkleProof.catch (src/BitcoinSPV.js:57:15)
      at processTicksAndRejections (internal/process/task_queues.js:86:5)

It may be caused by the unreliability of public testnet electrum servers. As part of this task, we need to investigate the problem and find a solution.

Possible solutions:

  1. Use stable public mainnet electrum server; update test data to reflect mainnet.
  2. Use our internal testnet electrum server; access it from CircleCI.
  3. Mock electrum server responses for unit tests; prepare separate integration test suite to test real electrum server.
nkuba commented 4 years ago

It happened also with our internal electrum server in the dapp (not in CI):

Error: failed to get bitcoin spv proof: 
Error: failed to get merkle proof: 
[Error: failed to get transaction merkle: 
[tx f1ee49a165835bfcb7860d056a5d891089218b128eaf3dcca32c6b0b06d3b2b6 not in block at height 1,583,023]]
Shadowfiend commented 4 years ago

Strongly in favor of option (3), fwiw.