Counterparty Development Update

December 26, 2014

This is the last development update in 2014, and although it’s the Holiday season, our devs have been working hard on stomping out bugs, refactoring the code and making overall progress.

As our team is growing and our project maturing, we expect some exciting development updates in the upcoming year. For now, let’s look at the changes implemented this week.

Resolving Issue with Socket Timeout

We had a ‘stubborn’ bug with random timeout errors. Most of the hotfixes below address the #554 issue, which has been resolved with the latest commit: One Proxy Per Thread, Passed Around as Parameter. Here are the rest of the changes implemented:

  • Fixed bug with the error: `AttributeError: ‘module’ object has no attribute ‘BitcoindError’
  • Implemented passing proxy in blocks.py for efficiency
  • Removed sharing of backend proxies
  • Dramatically increased HTTP timeout: python-bitcoinlib’s default is 30 seconds (and Bitcoin Core is sometimes very slow); HTTP timeout has now been set to one hour in config.py. However, this value doesn’t have any effect with python-bitcoinlib before v0.3.0.
  • Implemented one proxy per thread, passed around as parameter

Other Changes and Fixed

The rest of this week’s changes were also implemented in the counterpartyd repository:

  • Renamed version.json to protocol_changes.json: old version.json is being kept for backwards‐compatibility
  • Removed Callback Functionality: Callbacks were never live on mainnet and would be much better implemented in smart contracts. For API changes see the API ChangeLog. This change solves issues #552 and #78
  • Implemented overwriting the config file only if necessary
  • Updated Logging System
    • Share logger across modules
    • Shutdown logger gracefully
    • Log logging level
    • Simplify output
    • Coloured output (for WARNING, ERROR, CRITICAL)
    • Tweak logging of transaction skipping, decode errors
    • minor reformatting of miscellaneous import statements.
  • Fixed API Status Poller
    • API Status Poller wasn’t running at all
    • Improved logging of status polling
    • Misc. bugs in check.py
  • Implemented measuring how far behind the backend is in hours: Using seconds, as was done before, involved false precision.
  • Removed Unnecessary python-bitcoinlib Proxy
  • Implemented proxy as a required argument to get_tx_info*()
  • Updated the required version of python-bitcoinlib in pip-requirements.txt to 0.3.0: Solves #551.
  • Fixed bug with paying dividends in BTC: BTC dividends fail get_tx_info() Sanity Check in transaction.compose() [#558]
  • Implemented more elegant skipping of pure BTC transactions: Now, the sanity check in transaction.construct() only skips transactions which raise a particular BTC‐only exception. The use of such an exception distinguishes transactions that cannot be parsed from ones that simply shouldn’t be. (The former type should be caught by the sanity check.)
  • Fixed Bug introduced with recent logging updates [#560]
  • Added package url for python-bitcoinlib in pip-requirements: this package should be used until official upgrade
  • Made all calls to backend go through backend.py for better abstraction
  • Removed BTC balance check for orders with give_asset==BTC from message compose function

That covers our development updates for this week. If you have any questions regarding recent or upcoming changes you can contact us via our support channel, forum or github.