Coder Social home page Coder Social logo

bcash's People

Contributors

bitjson avatar blusyn avatar boymanjor avatar braydonf avatar bucko13 avatar chjj avatar coinables avatar czzarr avatar dionyziz avatar educationofjon avatar homeopatchy avatar indutny avatar jjz avatar jlopp avatar michaelfolkson avatar mnaamani avatar murtyjones avatar mvayngrib avatar nodech avatar orfeaslitos avatar pinheadmz avatar ralphtheninja avatar s0 avatar sandakersmann avatar sangaman avatar slashrsm avatar srsgores avatar thehobbit85 avatar tuxcanfly avatar tynes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcash's Issues

Swallowed errors in protocol-test.js due to Mocha bugs

So, reimplementing mocha has revealed a number of bugs in mocha itself. There's at least 3 or 4 cases where mocha is completely swallowing an error and not displaying it. One case in particular affects bcash. Example:

Mocha behavior:

$ mocha test/protocol-test.js


  Protocol
    ✓ should encode/decode version
    ✓ should encode/decode version
    ✓ should encode/decode verack
    ✓ should encode/decode addr
    ✓ should not limit block like packet size to MAX_MESSAGE (384ms)
    ✓ should limit block like packet size to MAX_FORK_BLOCK_SIZE * 2 (176ms)
    ✓ should limit packet size to MAX_MESSAGE


  7 passing (606ms)

The last two tests are actually throwing an error post-callback. I noticed this when bmocha was failing some tests.

Bmocha's original behavior:

$ bmocha test/protocol-test.js

  Protocol
    ✓ should encode/decode version
    ✓ should encode/decode version
    ✓ should encode/decode verack
    ✓ should encode/decode addr
    ✓ should not limit block like packet size to MAX_MESSAGE (345ms)
    1) should limit block like packet size to MAX_FORK_BLOCK_SIZE * 2
    2) should limit packet size to MAX_MESSAGE

  5 passing (565ms)
  2 failing

  6) Protocol
       should limit block like packet size to MAX_FORK_BLOCK_SIZE * 2:

      Error: Invalid magic value: 0.

      at Parser.error (/home/chjj/work/node_modules/bcash/lib/net/parser.js:57:24)
      at Parser.parseHeader (/home/chjj/work/node_modules/bcash/lib/net/parser.js:138:12)
      at Parser.parse (/home/chjj/work/node_modules/bcash/lib/net/parser.js:98:26)
      at Parser.feed (/home/chjj/work/node_modules/bcash/lib/net/parser.js:85:12)
      at Context.it (/home/chjj/work/node_modules/bcash/test/protocol-test.js:148:12)

  7) Protocol
       should limit packet size to MAX_MESSAGE:

      Error: Invalid magic value: 2c350fd.

      at Parser.error (/home/chjj/work/node_modules/bcash/lib/net/parser.js:57:24)
      at Parser.parseHeader (/home/chjj/work/node_modules/bcash/lib/net/parser.js:138:12)
      at Parser.parse (/home/chjj/work/node_modules/bcash/lib/net/parser.js:98:26)
      at Parser.feed (/home/chjj/work/node_modules/bcash/lib/net/parser.js:85:12)
      at Context.it (/home/chjj/work/node_modules/bcash/test/protocol-test.js:169:12)

So what's going on here? Mocha seems to be swallowing two errors.

Long story short, Mocha swallows errors in this case:

it('should succeed', (cb) => {
  cb();
  throw new Error('foobar'); // <-- swallowed
});

Which is exactly what's happening in test/protocol-test.js: the parser throws an error, triggers the callback, and the test passes. In the same call stack, the parser continues and tries to parse the "next" packet (because it's now in a bad state due to the failed size check), and throws an error.

The difference between mocha and bmocha is that bmocha waits one tick of the event loop to see if any uncatchable error occurs after the callback has been called (and even after that, will watch for any uncaught errors). Mocha ignores all further execution instantly once the callback is executed, and swallows any errors (this is nothing short of insane). So, what to do?

On the latest master, I decided to have this particular edge case "pass", but display a warning to the programmer:

  Protocol
    ✓ should encode/decode version
    ✓ should encode/decode version
    ✓ should encode/decode verack
    ✓ should encode/decode addr
    ✓ should not limit block like packet size to MAX_MESSAGE (345ms)
    ✓ should limit block like packet size to MAX_FORK_BLOCK_SIZE * 2 (184ms)
      ! swallowed error as per mocha behavior:
        Error: Invalid magic value: 0.
    ✓ should limit packet size to MAX_MESSAGE
      ! swallowed error as per mocha behavior:
        Error: Invalid magic value: 2c350fd.

  7 passing (564ms)

This is not all: I've noticed 2 or 3 more cases where errors, multiple promise rejections, and other weird cases have swallowed errors in mocha. I've started to documented them a little bit in in the bmocha tests -- the fail-test in particular has a number of tests which do not fail in mocha but fail in bmocha.

The moral of the story is that it was a mistake for us to ever use 3rd party code for something as critical as testing. Testing code should be small, sane, and easily auditable, which mocha is not. Any project of ours still using mocha should switch to bmocha as soon as possible.

We can wrap parser.feed() in a try catch to make it more aware of the error, but I suppose it doesn't matter as much now. This post is more to document mocha's shortcomings.

Web Cryptography API

Rather than using elliptic in the browser, would it be faster to perform cryptographic operations with the web crypto API? If there's a consensus that this would be effective and useful, I might submit a PR for it.

Zero transaction fee issue

In this transaction data returned from bcash API, the transaction fee is zero. But actually the fee should be 0.00000229, according to other online BCH explorers.

{
"hash": "a3617a2302aacafc87cb40182ece014d5e89a71588abb18b3a620f778896fb47",
"fee": 0,
"rate": 0,
"mtime": 1532996743,
"height": 539748,
"block": "00000000000000000007f2ff81048b5c71b9cb432f147be004c3196880b8544c",
"time": 1532061390,
"index": 296,
"version": 1,
"inputs": [
{
"prevout": {
"hash": "26a5e48f2fe2206925b4be6685378e4201e964db28926821ec45321dc4a3874e",
"index": 3
},
"script": "483045022100ac252ef8b1e86b5d77d50f149028e4f17a59554e1f2dd64fbd223d2396b0eda202204312ef0c7694d297d4ed5dc4f23b3587a61cd91189b23f1306cff256f60b6849412103a78fbf6f3dfd66621171630e84146e8e1df425365e44f2cef6d65e03f7fed1de",
"sequence": 4294967295,
"address": "bitcoincash:qrwd4ymttsk5tzuvnnaxr26ll3fl0apedupusq5fhf"
}
],
"outputs": [
{
"value": 80000,
"script": "76a914a928707e4a74740cdbacf87a390c45878f64e2ae88ac",
"address": "bitcoincash:qz5jsur7ff68grxm4nu85wgvgkrc7e8z4ce66elguv"
},
{
"value": 9809771,
"script": "76a9145b1b606a13db00b1f2d72e17b1f4acaf6738e8f888ac",
"address": "bitcoincash:qpd3kcr2z0dspv0j6uhp0v054jhkww8glqcfwd330x"
}
],
"locktime": 0,
"hex": "01000000014e87a3c41d3245ec21689228db64e901428e378566beb4256920e22f8fe4a526030000006b483045022100ac252ef8b1e86b5d77d50f149028e4f17a59554e1f2dd64fbd223d2396b0eda202204312ef0c7694d297d4ed5dc4f23b3587a61cd91189b23f1306cff256f60b6849412103a78fbf6f3dfd66621171630e84146e8e1df425365e44f2cef6d65e03f7fed1deffffffff0280380100000000001976a914a928707e4a74740cdbacf87a390c45878f64e2ae88ac6baf9500000000001976a9145b1b606a13db00b1f2d72e17b1f4acaf6738e8f888ac00000000",
"confirmations": 2453
}

Port updates and improvements from tests

from #9

Various test improvements

Various test fixes and other cleanups now that UAHF activation is past

Various fixes and improvements to test suite

Lots of improvements to the RPC test suite (Ports from Bitcoin Core)

Go through the corresponding commits in bitcoin-abc and port over or re-implement these tests.

Script Signature problem with bcash-transaction 'signrawtransaction' RPC call.

Hi,

I am trying to test a transaction model where given a valid testnet bitcoin cash address I a transfer funds from one address to another. I am able to fetch the UTXO's and I am able to create a raw transaction successfully using 'createrawtransaction' RPC. However, I feel like there is something wrong that is going on while I am signing the raw transaction using the 'signrawtransaction' RPC. There are no errors and I am also able to send the raw transaction but its not getting mined. So I tried to broadcast the transaction through 'https://test-bch-insight.bitpay.com/' and it returned an error saying

"An error occurred: 16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation). Code:-26"

Then the next step I took is to create the transaction using bitcoincashjs and compare the raw transaction after signature. There seems to be a difference in script signature for both of the raw transactions.

Decoding Bcash raw transaction:

{ "result":{ "txid":"4a63b8e508fd3b2db475f5f33b2259eb1db9e0fa8e14d002f48f81340edbd73f", "hash":{ "type":"Buffer", "data":[ 63, 215, 219, 14, 52, 129, 143, 244, 2, 208, 20, 142, 250, 224, 185, 29, 235, 89, 34, 59, 243, 245, 117, 180, 45, 59, 253, 8, 229, 184, 99, 74 ] }, "size":191, "version":1, "locktime":0, "vin":[ { "txid":"b5386f1196479ed09a700e3c545e3056244923ee100781d2e01ea50074028af7", "scriptSig":{ "asm":"30440220161cf68b6d123f0885224f142dac796032740af8e8f4407de4b80a97bba9e94502206427bb240eb316c0f0650c5adfd724ddf6a02ab21bc3009d52ef2393421e4d6141 03f1eca16f7a149255e47d14513ba7fbd7aebccdefe5ebf1e87481e544ad878471", "hex":"4730440220161cf68b6d123f0885224f142dac796032740af8e8f4407de4b80a97bba9e94502206427bb240eb316c0f0650c5adfd724ddf6a02ab21bc3009d52ef2393421e4d61412103f1eca16f7a149255e47d14513ba7fbd7aebccdefe5ebf1e87481e544ad878471" }, "sequence":4294967295, "vout":1 } ], "vout":[ { "value":0.01, "n":0, "scriptPubKey":{ "asm":"OP_DUP OP_HASH160 7beb3ad9baec5f26589be35a0c805a5d9ba6044a OP_EQUALVERIFY OP_CHECKSIG", "hex":"76a9147beb3ad9baec5f26589be35a0c805a5d9ba6044a88ac", "type":"PUBKEYHASH", "reqSigs":1, "addresses":[ "bchtest:qpa7kwkehtk97fjcn0345ryqtfwehfsyfgsgvqja0t" ] } } ], "blockhash":null, "confirmations":0, "time":0, "blocktime":0 }, "error":null, "id":null }

Decoding bitcoincashjs raw transaction

{ "result":{ "txid":"acef24502e990c9230805ac4217dc13d9ff074fe383ea75eb2a3ce3686afc771", "hash":{ "type":"Buffer", "data":[ 113, 199, 175, 134, 54, 206, 163, 178, 94, 167, 62, 56, 254, 116, 240, 159, 61, 193, 125, 33, 196, 90, 128, 48, 146, 12, 153, 46, 80, 36, 239, 172 ] }, "size":192, "version":1, "locktime":0, "vin":[ { "txid":"b5386f1196479ed09a700e3c545e3056244923ee100781d2e01ea50074028af7", "scriptSig":{ "asm":"3045022100d318b1747ce6cca924fd4fecf479466f0ed0a0e5a2860221dd286ece540e0b6702200e25431f737089809adf2da18db383094e38fa50c28ed24cb384803f46d598f941 03f1eca16f7a149255e47d14513ba7fbd7aebccdefe5ebf1e87481e544ad878471", "hex":"483045022100d318b1747ce6cca924fd4fecf479466f0ed0a0e5a2860221dd286ece540e0b6702200e25431f737089809adf2da18db383094e38fa50c28ed24cb384803f46d598f9412103f1eca16f7a149255e47d14513ba7fbd7aebccdefe5ebf1e87481e544ad878471" }, "sequence":4294967295, "vout":1 } ], "vout":[ { "value":0.01, "n":0, "scriptPubKey":{ "asm":"OP_DUP OP_HASH160 7beb3ad9baec5f26589be35a0c805a5d9ba6044a OP_EQUALVERIFY OP_CHECKSIG", "hex":"76a9147beb3ad9baec5f26589be35a0c805a5d9ba6044a88ac", "type":"PUBKEYHASH", "reqSigs":1, "addresses":[ "bchtest:qpa7kwkehtk97fjcn0345ryqtfwehfsyfgsgvqja0t" ] } } ], "blockhash":null, "confirmations":0, "time":0, "blocktime":0 }, "error":null, "id":null }

image

In testing this I have used the same address with same amounts for the transaction. I have used the bcash 'decoderawtransaction' to decode both the raw transactions. The signed raw transaction by bitcoincashjs is able to also mine.

FYI: I have used bcoin to create the same model for bitcoin and that works fantastic.

Kindly request the developers to through some light.

Thank you for your help in advance.

Aditya Taday

SPV sync fails on checkpoint 1188697

I tried to sync my spv node and it throws a warning on the checkpoint block 1188697.

The warning message produced is the following:
[warning] (chain) Tried to connect invalid block: 0000000000051b450faa75bb8e1ea30bc18c4b9736e765d2794259a53bc83f99 (1188698).

The block number 1188698 though is not invalid, since it is part of the main chain.

Wormhole Protocol

https://www.yours.org/content/bch-smart-contract-is-coming----wormhole-protocol-proposed-by-bitmain-1debc785b3f8

The Wormhole protocol is a superset of the Bitcoin Cash network
consensus(note: this sentence is 100% literal translation.) The
metadata it identifies is only the OP_RETURN data in the consensus
protocol of the Bitcoin Cash blockchain, and consensus rules of
Bitcoin Cash do not need to understand data in OP_RETURN.

Implementation
Wormhole protocol is implemented by integrating into Bitcoind.
But the consensus rules of Bitcoin Cash themself do not need
to be changed. Bitcoind clients that integrates the Wormhole
protocol are called Wormhole clients. Nodes running the
Wormhole client will be able to recognize the OP_RETURN
Wormhole protocol.

Seems like not all bitcoin cash nodes will need to support this?

ERR_ASSERTION when requesting UTXOs for a specific address

When I try to get UTXOs (endpoint /coin/address/${address}) for the address qqqqvm6vn3uvh6tcqk5kl0gt0ygzte5lay9yhumssf the following error is thrown:

{
  "error": {
    "type": "AssertionError",
    "code": "ERR_ASSERTION",
    "message": "false == true"
  }
}

I installed cloning the GitHub repository, and I'm using the branch master, wich is currently updated with all commits.

For other addresses there is no error.

The following trace can be found in the log file:

[D:2018-12-07T19:55:46Z] (http) Request for method=GET path=/coin/address/qqqqvm6vn3uvh6tcqk5kl0gt0ygzte5lay9yhumssf (10.120.2.47).
[E:2018-12-07T19:55:46Z] (node) false == true
AssertionError [ERR_ASSERTION]: false == true
    at AddrIndexer.getCoinsByAddress (/home/ec2-user/bcash/lib/indexer/addrindexer.js:163:9)
    at <anonymous>

confirmations issue

I have find also one issue.
when transaction was confirmed its worked correct.

{ hash: "6ad596961dce18d3aa189335f1cdd7340b9fd33407013e8ce88823dcdbb2605d", fee: 0, rate: 0, mtime: 1530011839, height: 536356, block: "0000000000000000007bbc99da84bba488da76f3e81d582eb4c9385d106a941f", time: 1530011795, index: 3, version: 1, inputs: [ { prevout: { hash: "b8f4acb87d0d7c6da0c2c505d69f53d060e70292949d3abbc8d9885906550200", index: 1, }, script: "483045022100cdf8c64b6650056273924f0adbc876a57e967654311dee9294d7b4b7dc3256ed02202a2a480b68b8a8c6faac493da9b62c16375907d98b772dc69725e625dd461ce441210386260469a4f4dd2115c7b700bb8a7b70fc1edb5f97dd1bda7aa00cf3869b4e1e", sequence: 4294967294, address: "bitcoincash:qr3e4qkual3wmutjae5lc98whyrjw3v8qsny83k8zz", } ], outputs: [ { value: 423199700, script: "76a914f7c86badc2aef379190e38b4ffc2aea7111356d188ac", address: "bitcoincash:qrmus6adc2h0x7gepcutfl7z46n3zy6k6yme7vrt42", }, { value: 576800000, script: "76a914d5046a06900312299addd8ec640c3480aa417bbf88ac", address: "bitcoincash:qr2sg6sxjqp3y2v6mhvwceqvxjq25stmhums6njkpv", }, ], locktime: 536355, hex: "0100000001000255065988d9c8bb3a9d949202e760d0539fd605c5c2a06d7c0d7db8acf4b8010000006b483045022100cdf8c64b6650056273924f0adbc876a57e967654311dee9294d7b4b7dc3256ed02202a2a480b68b8a8c6faac493da9b62c16375907d98b772dc69725e625dd461ce441210386260469a4f4dd2115c7b700bb8a7b70fc1edb5f97dd1bda7aa00cf3869b4e1efeffffff02d4833919000000001976a914f7c86badc2aef379190e38b4ffc2aea7111356d188ac00456122000000001976a914d5046a06900312299addd8ec640c3480aa417bbf88ac232f0800", confirmations: 7, }

confirmations: 7 is ok.
if transaction was unconfirmed it should be 0.
but it is height + 2.

Custom inspection function on Objects via .inspect() is deprecated

This is a new deprecation warning shown on Node 10 (nodejs/node#15549).

(node:10005) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated

It's shown whenever an object with inspect() defined is console.logged, like await wallet.receiveAddress(). As these inspect()s are spread out throughout the code the change needed is not trivial. The new API for this seems a bit cumbersome: https://nodejs.org/api/util.html#util_custom_inspection_functions_on_objects.

Repeating syntax error when attempting to setup full node?

Trying to start on an Apple Macbook Air (running High Sierra) I see a repeated error:

[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (some_ip_address:some_port)

I also repeatedly see this...

[info] (net) Initialized header chain to height 0

... which makes me think something is not working.

thanks for looking ... here is a bigger copy paste from my iTerm...

 => ./bin/bcash
[info] (chain) Chain is loading.
[info] (chain) Checkpoints are enabled.
[info] (chaindb) Opening ChainDB...
[info] (chaindb) ChainDB successfully loaded.
[info] (chaindb) Chain State: hash=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f tx=1 coin=0 value=0.0.
[info] (chain) Chain Height: 0
[debug] (chain) Memory: rss=55mb, js-heap=13/32mb native-heap=22mb
[debug] (chain) Memory: rss=55mb, js-heap=13/32mb native-heap=22mb
[info] (mempool) Mempool loaded (maxsize=97656.25kb).
[info] (miner) Miner loaded (flags=mined by bcoin).
[warning] (miner) No reward address is set for miner!
[info] (net) Pool loaded (maxpeers=8).
[info] (net) Initialized header chain to height 0 (checkpoint=0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d).
[info] (wallet) Added 22 hashes to WalletDB filter.
[info] (wallet) Added 0 outpoints to WalletDB filter.
[info] (wallet) WalletDB loaded (depth=1, height=0, start=0).
[info] (wallet) Resyncing from server...
[info] (wallet) Sending filter to server (5.1418256759643555mb).
[info] (wallet) Syncing state from height 0.
[info] (wallet) WalletDB is scanning 1 blocks.
[info] (wallet) Rolled back to same height (0).
[info] (chaindb) Scanning from block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f.
[info] (wallet) Wallet opened (primary).
[info] (chaindb) Scanning block 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f (0).
[warning] (wallet) Already saw WalletDB block (0).
[info] (wallet) Loaded primary wallet (id=primary, wid=0, address=1P4xG2KZBHPgD79sNPSNGTanauom255UJS)
[info] (http) Wallet HTTP server listening on 127.0.0.1 (port=8334).
[info] (http) Node HTTP server listening on 127.0.0.1 (port=8332).
[info] (node) Node is loaded.
[info] (chaindb) Finished scanning 1 blocks.
[info] (wallet) Resending from 1 wallets.
[info] (net) External IPv4 found (dns): 107.10.18.214.
[debug] (net) Could not find external IPv6 (dns).
[debug] (net) Error: queryAaaa ECONNREFUSED myip.opendns.com
[debug] (net) Connecting to 45.63.11.146:8333.
[info] (net) Adding loader peer (45.63.11.146:8333).
[debug] (net) Refilling peers (1/8).
[debug] (net) Connecting to 119.23.173.200:8333.
[debug] (net) Connecting to 52.210.252.123:8333.
[debug] (net) Connecting to 45.79.131.146:8333.
[debug] (net) Connecting to 138.197.18.29:8333.
[debug] (net) Connecting to 139.59.96.88:8333.
[debug] (net) Connecting to 139.162.172.224:8333.
[debug] (net) Connecting to 39.108.246.189:8333.
[info] (net) Pool server listening on 0.0.0.0 (port=8333).
[info] (net) Connected to 138.197.18.29:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (138.197.18.29:8333)
[info] (net) Connected to 45.79.131.146:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.79.131.146:8333)
[info] (net) Connected to 45.63.11.146:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.63.11.146:8333)
[info] (net) Removed loader peer (45.63.11.146:8333).
[info] (net) Initialized header chain to height 0 (checkpoint=0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d).
[info] (net) Connected to 139.162.172.224:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (139.162.172.224:8333)
[info] (net) Connected to 52.210.252.123:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (52.210.252.123:8333)
[info] (net) Connected to 119.23.173.200:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (119.23.173.200:8333)
[info] (net) Connected to 39.108.246.189:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (39.108.246.189:8333)
[info] (net) Connected to 139.59.96.88:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (139.59.96.88:8333)
[debug] (net) Connecting to 83.69.203.44:8333.
[info] (net) Adding loader peer (83.69.203.44:8333).
[debug] (net) Refilling peers (1/8).
[debug] (net) Connecting to 54.206.46.40:8333.
[debug] (net) Connecting to 35.158.82.156:8333.
[debug] (net) Connecting to 119.23.173.131:8333.
[debug] (net) Connecting to 118.31.164.147:8333.
[debug] (net) Connecting to 47.88.77.178:8333.
[debug] (net) Connecting to 104.236.231.51:8333.
[debug] (net) Connecting to 54.169.231.55:8333.
[info] (net) Connected to 104.236.231.51:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (104.236.231.51:8333)
[info] (net) Connected to 47.88.77.178:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (47.88.77.178:8333)
[info] (net) Connected to 35.158.82.156:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (35.158.82.156:8333)
[info] (net) Connected to 83.69.203.44:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (83.69.203.44:8333)
[info] (net) Removed loader peer (83.69.203.44:8333).
[info] (net) Initialized header chain to height 0 (checkpoint=0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d).
[debug] (net) Error: Socket Error: ECONNREFUSED (118.31.164.147:8333)
[info] (net) Connected to 54.206.46.40:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (54.206.46.40:8333)
[info] (net) Connected to 54.169.231.55:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (54.169.231.55:8333)
[info] (net) Connected to 119.23.173.131:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (119.23.173.131:8333)
[debug] (net) Connecting to 47.94.37.147:8333.
[info] (net) Adding loader peer (47.94.37.147:8333).
[debug] (net) Refilling peers (1/8).
[debug] (net) Connecting to 118.31.166.106:8333.
[debug] (net) Connecting to 50.116.5.32:8333.
[debug] (net) Connecting to 198.27.188.248:8333.
[debug] (net) Connecting to 47.88.189.180:8333.
[debug] (net) Connecting to 47.52.10.12:8333.
[debug] (net) Connecting to 118.31.166.116:8333.
[debug] (net) Connecting to 108.49.30.164:8333.
[info] (net) Connected to 50.116.5.32:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (50.116.5.32:8333)
[info] (net) Connected to 47.52.10.12:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (47.52.10.12:8333)
[info] (net) Connected to 47.94.37.147:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (47.94.37.147:8333)
[info] (net) Removed loader peer (47.94.37.147:8333).
[info] (net) Initialized header chain to height 0 (checkpoint=0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d).
[info] (net) Connected to 118.31.166.116:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (118.31.166.116:8333)
[debug] (net) Error: Socket Error: ECONNREFUSED (118.31.166.106:8333)
[info] (net) Connected to 47.88.189.180:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (47.88.189.180:8333)
[info] (net) Repurposing peer for loader (198.27.188.248:8333).
[debug] (net) Refilling peers (2/8).
[debug] (net) Connecting to 118.31.166.50:8333.
[debug] (net) Connecting to 45.32.188.51:8333.
[debug] (net) Connecting to 47.90.204.241:8333.
[debug] (net) Connecting to 24.48.13.87:8333.
[debug] (net) Connecting to 106.14.105.48:8333.
[debug] (net) Connecting to 106.15.56.81:8333.
[info] (net) Connected to 47.90.204.241:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (47.90.204.241:8333)
[info] (net) Connected to 24.48.13.87:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (24.48.13.87:8333)
[info] (net) Connected to 118.31.166.50:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (118.31.166.50:8333)
[info] (net) Connected to 106.15.56.81:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (106.15.56.81:8333)
[info] (net) Connected to 45.32.188.51:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.32.188.51:8333)
[info] (net) Connected to 106.14.105.48:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (106.14.105.48:8333)
[debug] (net) Refilling peers (2/8).
[debug] (net) Connecting to 98.151.16.60:8333.
[debug] (net) Connecting to 118.31.169.98:8333.
[debug] (net) Connecting to 45.33.14.27:8333.
[debug] (net) Connecting to 45.79.189.157:8333.
[debug] (net) Connecting to 106.15.57.46:8333.
[debug] (net) Connecting to 54.153.6.133:8333.
[info] (net) Connected to 45.79.189.157:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.79.189.157:8333)
[info] (net) Connected to 45.33.14.27:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.33.14.27:8333)
[info] (net) Connected to 54.153.6.133:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (54.153.6.133:8333)
[info] (net) Connected to 118.31.169.98:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (118.31.169.98:8333)
[info] (net) Connected to 106.15.57.46:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (106.15.57.46:8333)
[debug] (net) Error: Socket Error: ECONNREFUSED (98.151.16.60:8333)
[debug] (net) Refilling peers (2/8).
[debug] (net) Connecting to 45.79.78.233:8333.
[debug] (net) Connecting to 120.76.202.120:8333.
[debug] (net) Connecting to 13.126.209.117:8333.
[debug] (net) Connecting to 47.89.180.162:8333.
[debug] (net) Connecting to 106.15.53.5:8333.
[debug] (net) Connecting to 118.31.166.94:8333.
[info] (net) Connected to 47.89.180.162:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (47.89.180.162:8333)
[info] (net) Connected to 45.79.78.233:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.79.78.233:8333)
[debug] (net) Error: Socket Error: ECONNREFUSED (118.31.166.94:8333)
[info] (net) Connected to 106.15.53.5:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (106.15.53.5:8333)
[info] (net) Connected to 120.76.202.120:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (120.76.202.120:8333)
[info] (net) Connected to 13.126.209.117:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (13.126.209.117:8333)
[debug] (net) Error: Connection timed out. (198.27.188.248:8333)
[info] (net) Removed loader peer (198.27.188.248:8333).
[info] (net) Initialized header chain to height 0 (checkpoint=0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d).
[debug] (net) Error: Connection timed out. (108.49.30.164:8333)
[debug] (net) Connecting to 79.109.117.54:8333.
[info] (net) Adding loader peer (79.109.117.54:8333).
[debug] (net) Refilling peers (1/8).
[debug] (net) Connecting to 13.126.31.141:8333.
[debug] (net) Connecting to 139.196.189.47:8333.
[debug] (net) Connecting to 128.199.119.104:8333.
[debug] (net) Connecting to 45.79.89.253:8333.
[debug] (net) Connecting to 188.214.130.29:8333.
[debug] (net) Connecting to 54.158.87.15:8333.
[debug] (net) Connecting to 139.59.62.158:8333.
[info] (net) Connected to 54.158.87.15:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (54.158.87.15:8333)
[info] (net) Connected to 45.79.89.253:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (45.79.89.253:8333)
[info] (net) Connected to 79.109.117.54:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (79.109.117.54:8333)
[info] (net) Removed loader peer (79.109.117.54:8333).
[info] (net) Initialized header chain to height 0 (checkpoint=0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d).
[info] (net) Connected to 188.214.130.29:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (188.214.130.29:8333)
[info] (net) Connected to 139.196.189.47:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (139.196.189.47:8333)
[info] (net) Connected to 139.59.62.158:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (139.59.62.158:8333)
[info] (net) Connected to 13.126.31.141:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (13.126.31.141:8333)
[info] (net) Connected to 128.199.119.104:8333.
[debug] (net) Error: Socket Error: ERR_INVALID_ARG_TYPE (128.199.119.104:8333)
[debug] (net) Connecting to 118.31.164.108:8333.
[info] (net) Adding loader peer (118.31.164.108:8333).
[debug] (net) Refilling peers (1/8).
[debug] (net) Connecting to 45.79.210.130:8333.
[debug] (net) Connecting to 47.93.123.193:8333.
[debug] (net) Connecting to 47.95.34.221:8333.
[debug] (net) Connecting to 18.196.0.242:8333.

... I have relatively limited node experience ... maybe I have an installation / packages issue?

 => nvm current
v10.1.0
 => node -v
v10.1.0

peer: inclusion of regular btc packet magic.

It would be ideal to add a method of parsing both BTC / BCH Packet magic strings from inbound peers so that we're able to sync the full-node a bit quicker up until the 478559 block height.

Rename config file

config file still refers to ~/.bcash/bcoin.conf

should be ~/.bcash/bcash.conf

mempool list is null

Hi. in my bcash node finished sync process, but mempool is empty. and can not get mempool transactions..
{ version: "v1.0.0-alpha", network: "main", chain: { height: 535217, tip: "0000000000000000017b950154f3f6f5e700aaae6959e44bf7bbfa0c29f84b6f", progress: 1, }, pool: { host: "localhost", port: 8333, agent: "/bcash:v1.0.0-alpha/", services: "1", outbound: 100, inbound: 9, }, mempool: { tx: 0, size: 0, }, time: { uptime: 277, system: 1529326687, adjusted: 1529326687, offset: 0, }, memory: { total: 258, jsHeap: 16, jsHeapTotal: 18, nativeHeap: 239, external: 69, }, }

fully synced node /fee api returns zero rate

Any possible reasons?
status:

{
  "version": "1.1.0",
  "network": "main",
  "chain": {
    "height": 558178,
    "tip": "0000000000000000030bbaea3b921c3d08ee0686f1ea7411d391db3ac7113e29",
    "progress": 1
  },
  "pool": {
    "host": "*",
    "port": 8333,
    "agent": "/bcash:1.1.0/",
    "services": "1",
    "outbound": 8,
    "inbound": 0
  },
  "mempool": {
    "tx": 58,
    "size": 206904
  },
  "time": {
    "uptime": 89232,
    "system": 1543195153,
    "adjusted": 1543195153,
    "offset": 0
  },
  "memory": {
    "total": 333,
    "jsHeap": 23,
    "jsHeapTotal": 26,
    "nativeHeap": 307,
    "external": 14
  }
}

Ban peers with invalid magic

Lots of these messages in logs, probably an alternate chain node trying to connect. Should ban immediately to avoid reconnecting.

[debug] (peer) Rejecting packet from 23.92.36.61:6624: code=malformed reason=error parsing message.
[debug] (peer) Sending reject packet to peer (23.92.36.61:6624).
[debug] (net) Error: Invalid magic value: 0. (23.92.36.61:6624)
[debug] (peer) Rejecting packet from 23.92.36.61:6624: code=malformed reason=error parsing message.
[debug] (peer) Sending reject packet to peer (23.92.36.61:6624).

Port updates to indexer

There have been a couple of changes, including backports and improvements to indexer in bcoin.

Need to make sure once the PR is merged to port any changes that've occured after indexer was added to bcash.

Port monolith opcodes tests

We already have some test cases in script-test.json but for comprehensive test coverage, we should port over the monolith opcodes test cases.

Transactions get stuck on sending

Some of transactions get stuck on sending(using wallet plugin)
wallet.resend() does not work, but on node restart transactions appears in network

[error] (node) Verification failure: txn-already-in-mempool (code=alreadyknown score=0 hash=<tx hash>)
[warning] (node) Verification failed for tx: <tx hash>.
[warning] (node) Attempting to broadcast anyway...
  • logs on node restart and wallet.resend are the same
    using rojii/bcash#schnorr

npm i bcash failed

server os: ubuntu 16.04.4 LTS
node version 8.9.1
npm 5.6.0

I ran npm i -g bcash --production
it returned

+ [email protected]
added 1 package in 0.804s
bcash
zsh: command not found: bcash

perhaps it wasn't published on npm yet?

Issues when issuing RPC commands via POST

I'm trying to make an RPC call. Here's an example:

curl http://localhost:18334 \
  -X POST \
  --data '{
    "method": "estimatefee",
    "params": [ '1' ]
  }'

I get this response

{"result":null,"error":{"message":"Method not found: estimatefee.","code":-32601},"id":null}

Any idea what's wrong? I've taken that example from the docs. This also happens with all other commands that I've tried.

Bitcoin-ABC Release Tracking

0.14.2

  • DAA change that decreases difficulty if hashrate falls below 8%

0.14.3

  • Update bitcoin-tx to produce replay protected signatures
  • Update wallet to sign in replay protected manner once fork is active
  • Command line help for 'uahfstarttime' option
  • Fix a segmentation fault crash that could occur when peers disconnecting with high frequency (T64)

0.14.4

  • Various code cleanups, refactorings, style and formatting changes
  • Update block that's assumed to be valid
  • Various test improvements
  • Align ABC spec docs with UAHF specs of 2017-07-16
  • Ensure that CDataStream never reads from empty buffers.

0.14.5

  • Enforce strong replay protection (require SIGHASH_FORKID and SCRIPT_VERIFY_STRICTENC compliance)
  • Change currency units in user interface from BTC -> BCC
  • Add NODE_BITCOIN_CASH service bit (0x20)
  • Update BU backed seeder to btccash-seeder.bitcoinunlimited.info
  • Various refactoring and cleanups
  • NOTE: Change in default value: 'forcednsseed' is enabled by default to increase chance of good connection to UAHF network (see D360)

0.14.6

  • Updated debian packaging
  • Updated FreeBSD build instructions
  • Fix a bug where a node would erroneously increase the ban score of its peers when it hasn't caught up with the chain tip
  • Added various detail about peer misbehaving
  • Added criptolayer.net DNS seeds

0.15.0

  • Reserve block space for high priority transactions (D485)
  • Use "bitcoincash:" URI (D466)
  • Add and accept Bitcoin Cash networking magic (D400)
  • Peer preferentially with NODE_CASH nodes (D457) (see 0.16.2 for update)
  • Hardcoded seeds update (D403)
  • Remove UAHF RPC calls, and some of the UAHF activation logic (D407, D417)
  • Various test fixes and other cleanups now that UAHF activation is past
  • Various changes now that we do replay protected txns only (D437, D440, D442, D444, D451, D455, D456)
  • Make SCRIPT_VERIFY_STRICTENC a mandatory flag (D421)
  • Fix RPC signrawtransaction silently accepting missing amount field (D449)
  • Fix a some small memory leaks, and an overflow (D372, D452, D472)
  • Added sanitizer support (D474, D481)
  • Cryptographic randomness improvements (backport from Core PR9821 and PR9792) (D488, D490)
  • Store the UTXO set on a per output basis rather than a per transaction basis (backport from Core)
  • Various other backports and fixes from Core
  • Various fixes and improvements to test suite
  • Various code cleanups and style improvements
  • Low level RPC error code changes (D500 / backport of PR9853)

0.15.1

  • Cache script validation. Backport from Core 10192 (D527, D530, D531).
  • Add Amount class for CENT and COIN (D529).
  • Display if a node is using Cash magic in getpeerinfo (D546).
  • Use Cash magic by default when establishing connections (D547).
  • Add seeder to Bitcoin ABC repository. From Bitcoin Seeder by Pieter Wiulle. (D559, D560, D561, D562, D564, D565, D566, D568, D579, D585)
  • Ensure backupwallet fails if target is the same as source (D550).
  • Upgrade to LevelDB 1.20. Port of Core 10544 and 10958 (D580, D584).
  • Various backports from Core.
  • Various bug fixes.
  • Various style fixes, code cleanups, and refactorings.

0.16.0

  • New difficulty adjustement algorithm due to activate on Nov, 13
  • Start enforcing LOW_S and NULLFAIL after Nov, 13

0.16.1

  • Update seeds

0.16.2

  • Remove the newdaaactivationtime configuration.
  • Do not use the NODE_BITCOIN_CASH service bit for preferencial peering anymore.
  • Only connect to node using the cash magic.
  • Remove indicator mentionning if a node uses the cash magic getpeerinfo RPC.
  • Add support for the new cashaddr format. The -usecashaddr flag can be used to select which format is used when presenting addresses to users. By default, Bitcoin ABC will keep using the old format until Jan, 14 and then switch to the new format. Both format are now accepted as input.

0.17.0

  • Add monolithactivationtime configuration in order to chose when the May, 15 hard fork activates. This value should not be changed in production, but it allows user to test the fork activation ahead of time.
  • dumpwallet no longer allows overwriting files. This is a security measure as well as prevents dangerous user mistakes.
  • Node using the wrong magic are now getting banned.
  • cmake builds are now possible for bitcoind and other utilities.
  • Correct open source to open-source in README.md (Props to John Carvalho)
  • Add SSE4 optimized SHA256 (Port from Bitcoin Core)
  • Multiwallet support (Port from Bitcoin Core)
  • Lots of improvements to the RPC test suite (Ports from Bitcoin Core)
  • Uptime rpc command (Port from Bitcoin Core)
  • At the MTP time of 1526400000 (Tue May 15 16:00:00 UTC, 2018) the following behaviors will change:
  • Increase the default datacarriersize to 220 byte at the MTP time of 1526400000
  • Increase the maximum blocksize to 32,000,000 bytes at the MTP time of 1526400000
  • Re-activate the following opcodes: OP_CAT, OP_AND, OP_OR, OP_XOR, OP_DIV, OP_MOD
  • Add the following new opcodes: OP_SPLIT to replace OP_SUBSTR, OP_NUM2BIN, OP_BIN2NUM

Fee rate constant

Fee rate calculated by mempool mempool.fees.estimateFee(targetBlock, true) is always 1008 s/kb(for any targetBlock), so calculated fee is 0.00000228 bch
So transaction is broadcasted but there is no such tx on any explorer

used rojii/bcash, branch schnorr and multisig

Cleanup chain flags

bi91 bip148 witness indexTX indexAddress are all unnecessary and should be cleaned up.

Verify wallet uses LOW_S

Since HIGH_S signatures are no longer valid, we need to make sure our wallet doesn't produce them. If it does we need to alert the user about invalid signature.

Cleanup migrations

All the migrations are for legacy upgrades which don't matter for bcash. We need to cleanup and reset them for release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.