Skip to content

Releases: CounterpartyXCP/counterparty-core

v10.4.4

09 Oct 19:33
679ab89
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.4.4 (2024-10-09)

This is a minor release with a number of bugfixes and minor improvements to the API.

Upgrading

This release is not a protocol change and does not require a database reparse.

ChangeLog

Bugfixes

  • Handle invalid scripts in outputs properly
  • Fix last_block in get_running_info command (API v1)
  • Fix blockchain reorganization support

Codebase

  • Add regtest support in RSFetcher

API

  • Add Gunicorn support

CLI

  • Add wsgi-server (werkzeug or gunicorn) and gunicorn-workers flags
  • Enable Sentry Caches and Queries pages

Credits

  • Ouziel Slama
  • Warren Puffett
  • Adam Krellenstein

v10.4.3

05 Oct 14:58
6bfc1a3
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.4.3 (2024-10-05)

This is a minor release with a number of bugfixes and minor improvements to the API.

Upgrading

This release is not a protocol change and does not require a database reparse.

ChangeLog

Bugfixes

  • Fix asset_events during an asset ownership transfer
  • Refresh XCP supply in API DB on startup
  • Clean mempool after each block when catching up
  • Tweak mempool cleaning in API Watcher
  • Fix AttributeError on get_transactions (API v1)
  • Catch BadRequest error (API v2)
  • Fix off-by-one error in RSFetcher reorg logic

Codebase

  • Add regtest and mainnet test for the healthz endpoint
  • Re-enable check.asset_conservation() and run it in the background, in a separate thread, both at startup and every 12 hours

API

  • Use the GitHub repository for the Blueprint URL
  • Add the /v2/routes route in the /v2/ result
  • Add the addresses argument to the /v2/mempool/events route
  • Support prefixed data for /v2/transactions/unpack
  • Return assets issued and owned by <address> in /v2/addresses/<address>/assets
  • Add the following routes:
    • /v2/addresses/<address>/assets/issued
    • /v2/addresses/<address>/assets/owned

CLI

Credits

  • Ouziel Slama
  • Warren Puffett
  • Adam Krellenstein

v10.4.2

03 Oct 08:03
9e3cca8
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.4.2 (2024-10-02)

This is a small but important release which includes fixes for a number of node stability issues and updates to the API. All node hosts should upgrade as soon as possible.

Upgrading

This release is not a protocol change and does not require any reparsing. A regression in the v1 API has been resolved.

ChangeLog

Protocol Changes

Bugfixes

  • Retry indefinitely when RSFetcher cannot connect to Bitcoin Core
  • Fix RSFetcher startup logic
  • Restart RSFetcher when it is found to have been stopped
  • Fix JSON serialization of bytes in API v1

Codebase

  • Fix Docker Compose test
  • Fetch old mempool entries from Bitcoin Core after node startup

API

  • Disable expiration of mempool entries after 24 hours
  • Expose timestamp field for mempool transactions (for client-side filtering)
  • Revert accidental change in API v1 (renamed unsigned_tx_hex to tx_hex in create_*() result)
  • Disable p2sh encoding, which no longer works with recent versions of Bitcoin Core

CLI

Credits

  • Ouziel Slama
  • Warren Puffett
  • Adam Krellenstein

v10.4.1

24 Sep 20:31
9fbb082
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.4.1 (2024-09-24)

This release is a minor update with miscellaneous bugfixes.

Upgrading

This release fixes an old bug leading to potential undefined behavior for dispenser refills. No database reparse is required.

ChangeLog

Protocol Changes

Bugfixes

  • Fix order cache: update cache when an order is filled
  • Fix typo in protocol_changes.json
  • Fix division by zero in api.util.divide()
  • Catch invalid raw transaction in /v2/transactions/info endpoint
  • Fix duplicate command in xcpcli.py
  • Fix source field when refilling a dispenser created by a different source

Codebase

  • Don't report expected errors to Sentry in API v1
  • Use trace instead of warning for "Prefetch queue is empty." message
  • Use debug for expected and handled yoyo migration error
  • Support Python 3.10 and 3.11 only
  • Refactor and clean up transaction.py. The contents of this file are now distributed across lib/api/compose.py, lib/transaction_helper/transaction_outputs.py, and lib/transaction_helper/transaction_inputs.py.

API

  • Add support for inputs_set parameter
  • Rename the fee argument to exact_fee (the fee argument is still available in API v1)
  • Have the composition API return, in addition to a rawtransaction or a psbt, the following fields: data, btc_in, btc_out, btc_change, and btc_fee
  • Add sort argument for orders, order_matches and dispenser
  • Add the following route:
    • /v2/transactions/<tx_hash>/info (This route works if the tx is in the mempool of the queried node)

CLI

Credits

  • Ouziel Slama
  • Warren Puffett
  • Adam Krellenstein

v10.4.0

18 Sep 13:52
827ae09
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.4.0 (2024-09-18)

This is a major release with numerous protocol upgrades that will dramatically increase the functionality of the Counterparty protocol as well as resolve some long-standing security issues, in addition to a number of bugfixes and quality-of-life improvements.

Upgrading

If you run a Counterparty node, be sure to upgrade your node as soon as possible. Your node must be upgraded by block 866,000, which should be mined around October 16th, 2024, approximately four weeks from today.

The upgrade procedure should be straightforward: the API remains backwards-compatible, and the node will not have to perform a reparse. There are, however, two notable changes in this release that will require attention:

  1. It will no longer be possible to create a dispenser from an address that you don’t control. You will have to create the dispenser from the source address of the transaction, like all other Counterparty transactions.

  2. It will no longer be possible to trigger dispensers using vanilla Bitcoin wallets. The create_send API call has been modified so that it will automatically turn any BTC send to a dispenser into a create_dispense transaction.

ChangeLog

Protocol Changes

Bugfixes

  • Fix adding new transactions in unit test fixtures (scenarios.py)
  • Fix mempool parsing on testnet and regtest
  • Fix get_dispensers_by_asset endpoint filtering by query parameter. Numeric statuses can now be used, e.g. status=0.
  • Fix cursor type in API routes
  • Fix ledger.get_last_db_index() (server is ready on BLOCK_PARSED not on NEW_BLOCK)
  • Fix ledger.get_block(block_index) function
  • Check that the previous block is present when a block is received with ZeroMQ
  • Log API v1 responses

Codebase

  • New test suite and github workflow with regtest network
  • Delete mempool events older than 24 hours
  • Use order caching only during catch-up

API

  • Add return_only_data argument for composition routes
  • Add an asset_events field to the issuances table. This field contains one or more of the following values ​​separated by spaces: creation, reissuance, reset, lock_quantity, lock_description, open_fairminter, close_fairminter, fairmint.
  • Return only valid issuances
  • Generate API blueprint from regtest node
  • Run Dredd tests on regtest node
  • Add the new following routes:
    • /v2/order_matches
    • /v2/bitcoin/getmempoolinfo

CLI

Credits

  • Ouziel Slama
  • Warren Puffett
  • Adam Krellenstein

v10.3.2

11 Aug 16:40
929d8aa
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.3.2 (2024-08-11)

This release is a minor update with some bugfixes.

Upgrading

This release is not a protocol change and does not require any reparsing.

ChangeLog

Bugfixes

  • Fix get_value_by_block_index() on regtest
  • Fix events hash mismatch after a reparse
  • Fix regtest default ports
  • Fix /v2/assets/XCP route
  • Fix queries on messages table (remove mempool filtering)
  • Fix graceful closing of counterparty.db
  • Fix Get XCP Holders route
  • Fix division by zero in API market prices

Codebase

API

CLI

  • Move Counterparty Node UUID from ~/counterparty-node-uuid to ~/.local/state/counterparty/.counterparty-node-uuid

Credits

  • Ouziel Slama
  • Adam Krellenstein
  • Warren Puffett
  • Matt Marcello

v10.3.1

07 Aug 11:02
4434a4d
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.3.1 (2024-08-07)

This release is a relatively minor update with a large number of improvements to the node API, as well as a few important bugfixes and tweaks to the CLI and telemetry subsystems.

Upgrading

This release is not a protocol change and does not require any reparsing.

ChangeLog

Bugfixes

  • Fix cache for /v2/bitcoin/* routes
  • Fix queries by asset_longname
  • Fix capture exception by Sentry
  • Be sure not to cache orders and dispenser addresses from mempool
  • Catch UnicodeError in transactions.unpack() function
  • Fix script_to_address() function on Regtest

Codebase

API

  • Add the following routes:
    • Get Balances By Addresses
    • Get Events By Addresses
    • Get Mempool Events By Addresses
    • Get Order Matches By Asset
    • Get Order Matches By Two Assets
    • Get Subassets By Asset
    • Get Unspent Txouts By Addresses
  • Capitalize <asset> in routes
  • Accept asset_longname for GET /v2/assets/<asset>/issuances
  • Add default values for the locked and reset fields in issuances table
  • Add XCP to the assets_info table
  • Remove timestamp from events in API results
  • Standardize the format of mempool events and confirmed events
  • Use strings instead of integers to query dispensers by status
  • Accept several statuses for querying dispensers, orders and order_matches
  • Add sort argument for the following routes:
    • /v2/assets/<asset>/balances
    • /v2/addresses/<address>/balances
    • /v2/addresses/balances
  • Sort orders by tx_index DESC
  • Insert return_psbt argument for compose endpoints
  • Insert market_price when getting orders or order matches by two assets
  • Make queries to get orders or order matches by two assets case-insensitive
  • Make unconfirmed objects (transactions, issuances, orders, etc.) accessible via the API with the parameter ?show_unconfirmed=true
  • Inject fiat_price and oracle info in dispensers
  • Include decoded transaction in the result of /v2/transactions/info
  • Return null when destination field is empty
  • Support comma-separated addresses for the <address> value in API routes
  • Catch CBitcoinAddressError correctly
  • Return a 400 error instead a 503 on ComposeError and UnpackError

CLI

  • Add --json-logs flag for displaying logs in the JSON format
  • Send telemetry data after each block
  • Reduce Sentry Trace Sample Rate to 10%

Credits

  • Ouziel Slama
  • Adam Krellenstein
  • Warren Puffett

v10.3.0

12 Jul 19:49
8709877
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.3.0 (2024-07-12)

This version most notably introduces a major performance optimization for node API access: an additional SQLite3 database has been added which tracks the current state of all Counterparty objects (in addition to the primary database that is purely log-structured). Other major changes for this version include the removal of the kickstart functionality, which is possible now that start is performant, and numerous tweaks and improvements to the v2 API.

Upgrading

This update requires an automatic full reparse of the Counterparty transactions to populate the new database file. This process may take a number of hours to complete.

ChangeLog

Bugfixes

  • Fix verbose logging of order matches
  • Fix the order of NEW_TRANSACTION events on reparse
  • Check the ZMQ rawblock topic more frequently on testnet
  • Trigger NEW_TRANSACTION_OUTPUT events during a reparse
  • Fix incorrect messages_hash after a reparse
  • Fix silent errors in ZMQ follower
  • Catch TimeoutError during version check; re-check on error
  • Catch Bitcoin Core API errors correctly
  • Show warning to user when Bitcoin Core cannot be reached

Codebase

  • Remove UPDATE query for the addresses table
  • Add NEW_ADDRESS_OPTIONS and ADDRESS_OPTIONS_UPDATE events
  • Add tx_hash to DISPENSE_UPDATE event
  • Add event_hash field to the messages table
  • Add a new database optimized for the API. This new database is reconstructed only from events by the API Watcher, and a new field messages.event_hash ensures the correspondence between the two databases in the event of a blockchain reorganization.
  • Parse transactions vouts with Rust
  • Optimize get_matching_orders() with consolidated cache

API

  • Introduce the following new routes:
    • /v2/transactions/<tx_hash>/sends
    • /v2/transactions/<tx_hash>/dispenses
    • /v2/dispenses
    • /v2/sends
    • /v2/issuances
    • /v2/issuances/<tx_hash>
    • /v2/sweeps
    • /v2/sweeps/<tx_hash>
    • /v2/broadcasts
    • /v2/broadcasts/<tx_hash>
    • /v2/assets/<asset>/info
  • Add quantity_normalized to issuances endpoints
  • Increase the detail for the InsufficientBTC error
  • Inject unpacked_data into all results containing a data field when verbose=true
  • Remove asset_info from the ASSET_ISSUANCE event
  • Standardize on trailing zeros for divisible quantities
  • /v2/orders/<order_hash>/matches returns all order matches by default
  • Fix cache for /v2/blocks/last route
  • Clean and enrich message_data for MPMA sends
  • Support dispense message type
  • Add supply_normalized to asset info object in API responses
  • Add btc_amount to API responses returning dispenses objects
  • Use all as the default status when returning orders objects
  • Provide link to Apiary documentation in the root route for the v2 API

CLI

  • Remove all kickstart functionality; start is now recommended for the initial catchup.
  • Tweak RPS logging
  • Fix erroneous Rust Fetcher errors on shutdown
  • Use millisecond precision for logging

Credits

  • Ouziel Slama
  • Adam Krellenstein
  • Warren Puffett

v10.2.0

11 Jun 16:21
0319293
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.2.0 (2024-06-11)

This is a large release that includes significant refactoring and redesigns of critical node components, including the CLI and logging subsystems, mempool processing, and API database connection management. It also includes numerous updates and extensions to the v2 API, plus new ZeroMQ support. Of course, a large number of bugs have been resolved as well.

Upgrading

The counterparty-server process now uses ZeroMQ to communicate with Bitcoin Core, in addition to the traditional RPC API. You must configure Bitcoin Core with:

[main]
zmqpubrawtx=tcp://0.0.0.0:9332
zmqpubhashtx=tcp://0.0.0.0:9332
zmqpubsequence=tcp://0.0.0.0:9332
zmqpubrawblock=tcp://0.0.0.0:9333
[test]
zmqpubrawtx=tcp://0.0.0.0:19332
zmqpubhashtx=tcp://0.0.0.0:19332
zmqpubsequence=tcp://0.0.0.0:19332
zmqpubrawblock=tcp://0.0.0.0:19333

Note: This update requires a reparse from Block 819250, which will proceed automatically upon initialization.

ChangeLog

Bugfixes

  • Fix circular imports
  • Return 404 errors for undefined API routes
  • Fix nested result value in the v1 API
  • Fix burned, earned, and btc_amount_normalized fields in API results
  • Do not cache non-cacheable v2 API routes (which could lead to a broken health check, in particular)
  • Fix the execution interval of the APIStatusPoller thread
  • Add Access-Control-Allow-Headers = * header to API v2 for CORS

Codebase

  • Refactor mempool management and block tracking—catching up is now done via RPC, and tracking via ZeroMQ
  • Introduce a new Rust module to fetch blocks from Bitcoin Core over RPC. Calls are now massively parallelized and buffered; block fetching no longer slows down block parsing
  • Refactor the backend module; separate calls to Bitcoin Core and AddrIndexRs into two different modules
  • Add the indexed tx_hash field to the messages table
  • Update rowtracer so that apsw returns a boolean instead of an integer for BOOL type fields
  • Delete the defunct implementation of rock-paper-scissors; introduce a replay_events() function to reconstruct the database from a hard-coded list of historical events
  • Enable parsing blocks while Bitcoin Core is still catching up
  • Optimize get_pending_dispensers() by adding the last_status_tx_source and close_block_index fields to the dispensers table; optimize is_dispensable() by caching a list of all dispenser addresses
  • Add the transaction_count field to the blocks table
  • Add the following new database indexes:
    • credits.calling_function
    • debits.action
    • transactions.source
    • credit.quantity
    • debit.quantity
    • balance.quantity
    • dispenser.give_quantity
    • order.get_quantity
    • order.give_quantity
    • dispense.dispense_quantity
  • Add the new EVENT log level
  • Disable the automatic SQLite ‘quick check’ for when the database has not been closed correctly. Display an error message when exiting and at the next restart.
  • Add retries to get_oldest_tx() on a Addrindexrs timeout

API

  • Introduce the following new routes:
    • /v2/assets/<asset>/dispenses
    • /v2/addresses/<address>/issuances
    • /v2/addresses/<address>/assets
    • /v2/addresses/<address>/transactions
    • /v2/addresses/<address>/dividends
    • /v2/addresses/<address>/orders
    • /v2/addresses/<address>/dispenses/sends
    • /v2/addresses/<address>/dispenses/receives
    • /v2/addresses/<address>/dispenses/sends/<asset>
    • /v2/addresses/<address>/dispenses/receives/<asset>
    • /v2/blocks/<block_hash>
    • /v2/blocks/last
    • /v2/transactions
    • /v2/transactions/<int:tx_index>/events
    • /v2/transactions/<tx_hash>/events
    • /v2/transactions/<int:tx_index>/events/<event>
    • /v2/transactions/<tx_hash>/events/<event>
    • /v2/transactions/<int:tx_index>
    • /v2/dividends
    • /v2/dividends/<dividend_hash>
    • /v2/dividends/<dividend_hash>/credits
    • /v2/mempool/transactions/<tx_hash>/events
    • /v2/events/<event>/count
    • /v2/bets
    • /v2/orders
    • /v2/dispensers
  • Introduce the cursor API parameter
  • Include next_cursor and result_count fields in all responses
  • Accept cursor/offset and limit arguments in all queries that return lists from the database (see the Pagination paragraph of the API Documentation)
  • Make the asset, assets, give_asset, and get_asset parameters case-insensitive
  • Add the named=true|false parameter to /v2/assets to returning only named / numeric assets
  • Publish events on the ZeroMQ Pub/Sub channel
  • Implement database connection pooling for both API v1 and v2
  • Enrich results containing block_index with block_time when verbose=true
  • Add an action filter for the */credits and */debits routes
  • Add an event_name filter for the */events routes
  • Specify issuer=None within XCP and BTC asset information
  • Exclude zero balances in the results of /v2/addresses/<address>/balances and zero quantities in the results of */credits and */debits
  • Add BTC sent to the DISPENSE event
  • Accept trailing slashes in routes
  • Include first_issuance_block_index and last_issuance_block_index in asset information
  • Add normalized quantities for the following fields:
    • fee_paid
    • fee_provided
    • fee_required
    • fee_required_remaining
    • fee_provided_remaining
    • fee_fraction_int
    • quantity_per_unit
    • btc_amount_normalized
    • burned
    • earned
    • dispense_quantity
  • Return asset info for dispenses
  • Add confirmation_target argument for compose endpoints

CLI

  • Use -v for the DEBUG level, -vv for the EVENT level, and -vvv for the TRACE level (it is also possible to repeat the --verbose flag)
  • Clean up and refactor CLI outputs for all commands
  • Clean up log messages and add numerous additional logging statements

Credits

  • Ouziel Slama
  • Adam Krellenstein
  • Warren Puffett
  • Matt Marcello

v10.1.2

08 May 09:20
aac6448
Compare
Choose a tag to compare

Release Notes - Counterparty Core v10.1.2 (2024-05-08)

This version of Counterparty Core marks the release of API v2, a new RESTful API—see the official project documentation. The new API is available at /v2/, while the old API is now available at /v1/ in addition to /.

Upgrading

There is a guide for migrating from the v1 to the v2 API in the documentation, which specifies equivalences between old and new functionality.

This release maintains full backwards-compatibility and includes no protocol changes.

ChangeLog

Bugfixes

  • Fix logging of some raw tracebacks (#1715)
  • Retry on ChunkedEncodingError with AddrIndexRs; break loop on all errors
  • Fix bad logging of Rust module panic (#1721)

Codebase

  • Release API v2
  • Have both API v1 and v2 return ready if the last block is less than one minute old
  • Add an index on the block_index field in the credits and debits tables
  • Add TRACE level to Python logging
  • Add basic anonymous node telemetry

Command-Line Interface

  • Set default and minimum values for Backend Poll Interval to 3.0 seconds
  • Update docker-compose.yml to use different profiles for mainnet and testnet
  • Check that another process is not connected to the database before starting the server
  • Launch database quick check on startup if the database has not been correctly shut down
  • Support an additional level of verbosity with the CLI flags -vv
  • Add the --no-telemetry flag to disable node telemetry

Credits

  • Ouziel Slama
  • Adam Krellenstein
  • Warren Puffett
  • Matt Marcello