v10.0.0-alpha
Pre-releaseRelease Notes - Counterparty Core v10.0.0-alpha
Counterparty Core v10.0.0 is a very large release comprising many improvements across different portions of the codebase. “Counterparty Core” is also the new name for the codebase and repository that is the result of a merge between counterparty-lib
, counterparty-cli
and a new Rust library, counterparty-rs
.
Upgrade Procedure
This release does not include any protocol changes, so there is no deadline for upgrading. However it is strongly recommended that all users upgrade as soon as possible, in particular to avoid consensus problems due to non-determinism in previous versions. The Counterparty Core API is also unchanged for this release.
Because this release includes numerous changes to the database schema, a full database rebuild is required and the major version number has been bumped from 9 to 10. Follow the updated installation instructions in the README to download and install the latest version of Counterparty Core, run counterparty-server kickstart
(while bitcoind
is not running), then start the server with counterparty-server start
. The rebuild should happen automatically, and it should take between 8 and 24 hours hours to complete.
IMPORTANT Be certain that you are running the latest version of AddrIndexRs (v0.4.3).
ChangeLog
Codebase
- Upgrade from Python 3.7 to Python >= 3.10
- Support Ubuntu 22.04 and macOS officially
- Upgrade packaging system: replace
setup.py
withpyproject.toml
and use Hatchling as a build system - Upgrade all pip dependencies to the latest available version
- Rename
counterparty-lib
repository tocounterparty-core
. NOTE: The normal redirect for GitHub URLs cannot be implemented. - Merge the
counterparty-cli
repository into thecounterparty-core
repository - Add Rust library,
counterparty-rs
, for performance-critical code - Synchronize versions of
counterparty-rs
,counterparty-lib
andcounterparty-cli
- Update URL for hosting bootstrap files to https://bootstrap.counterparty.io/counterparty-*
- Update URL for hosting notifications for protocol changes to https://counterparty.io/protocol_changes.json
Documentation and Testing
- Fix test suite, with automated builds on supported operating systems
- Add Github Workflows for building, testing and running automated code scanners:
- PyLint
- Bandit
- CodeQL
- License Scanner
- Add checkpoints for
mainnet
up to block 825,000 and fortestnet
up to block 2,540,000 - Rewrite README
Stability and Correctness
- Fix multiple sources of non-determinism caused by generic exception handling
- Fix source of non-determinism in AddrIndexRs caused by
txid_limit
andget_oldest_tx
- Fix consensus break due to missing support for segwit transactions in
kickstart
logic - Fix crash in software version checking caused by a format change of
protocol_changes.json
Deployment
- Rewrite Dockerfile and publish new official Docker images
- Implement
simplenode
Docker Compose file, an alternative to Federated Node - Change default
bitcoind
user frombitcoinrpc
torpc
- Changed default port for communication with AddrIndexRs to
8432
(and81432
fortestnet
)
Command-Line Interface
- Disable console logs except for with
counterparty-server start
- Show fancy spinners for all discrete operations
- Rename
checkdb
command tocheck-db
- Rename
debugconfig
toshow-config
; clean up output - Don't log values for transactions except with
--verbose
(for performance) - Move noisy log messages to
DEBUG
- Always log to a file, unless
--no-log-files
is set - Fix and refactor
log.set_up()
- Improve thread shutdown logic
Refactoring and Performance Optimizations
- Rewrite
kickstart
, splitting work across two Python processes using shared memory and queue for communication - Activate write-ahead-log in SQLite and implement
apsw.best_pratices()
, improving performance and fixing crashes from deadlocks - Fix database version checking which launched a rebuilds instead of rollbacks / reparses
- Add numerous missing database indexes
- Fix collisions between existing database indexes
- DRY and refactor database index creation.
- DRY and isolate all SQL queries in
ledger.py
(except first insertion still inside contracts) - Fix database integrity check and re-include assert conservation check
- Migrate to log-structured database for simpler and faster rollback and reparse
- Add
block_index
field to thebalances
table - Remove all
UPDATE
queries—use theledger.insert_update()
function, which adds a new row with a newblock_index
- Update all
SELECT
queries—always useMAX(rowid)
- Remove the
undolog
completely - Implement
rollback
andreparse
by deleting table rows using theblock_index
field
- Add
- Migrate performance-critical logic to Rust library,
counterparty-rs
b58_encode()
andb58_decode()
script_to_asm()
script_to_address()
inverse_hash()
- Refactor connection logic for AddrIndexRs RPC
- Pre-fetch blocks with multiple threads for
start
- DRY and refactor
get_tx_info*()
functions- Isolate transaction parsing inside
gettxinfo.py
module - Heavily refactor code; eliminate unused code blocks
- Isolate dispenser logic in
get_dispensers_outputs()
andget_dispensers_tx_info()
- Isolate transaction parsing inside
Credits
- Ouziel Slama
- Adam Krellenstein
- Warren Puffett