Skip to content

Commit

Permalink
Merge branch 'develop' into fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ouziel committed Oct 3, 2024
2 parents 0994d8a + cc9c41e commit 73272db
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 24 deletions.
2 changes: 1 addition & 1 deletion apiary.apib
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ Returns server information and the list of documented routes in JSON format.
"result": {
"server_ready": true,
"network": "mainnet",
"version": "10.4.1",
"version": "10.4.2",
"backend_height": 850214,
"counterparty_height": 850214,
"documentation": "https://counterpartycore.docs.apiary.io/",
Expand Down
2 changes: 1 addition & 1 deletion counterparty-core/counterpartycore/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


# Semantic Version
__version__ = "10.4.1" # for hatch
__version__ = "10.4.2" # for hatch
VERSION_STRING = __version__
version = VERSION_STRING.split("-")[0].split(".")
VERSION_MAJOR = int(version[0])
Expand Down
6 changes: 3 additions & 3 deletions counterparty-core/counterpartycore/lib/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def determine_encoding(
else:
encoding = desired_encoding

if encoding == "p2sh" and not util.enabled("p2sh_encoding"):
raise exceptions.TransactionError("P2SH encoding not enabled yet")
if encoding == "p2sh":
raise exceptions.TransactionError("`P2SH` encoding deprecated, please use `multisig`")

elif encoding not in ("pubkeyhash", "multisig", "opreturn", "p2sh"):
if encoding not in ("pubkeyhash", "multisig", "opreturn"):
raise exceptions.TransactionError("Unknown encoding‐scheme.")

return encoding
Expand Down
19 changes: 18 additions & 1 deletion counterparty-core/counterpartycore/test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pycoin.coins.bitcoin import Tx # noqa: F401

from counterpartycore import server
from counterpartycore.lib import arc4, config, database, ledger, log, script, util
from counterpartycore.lib import arc4, config, database, exceptions, ledger, log, script, util
from counterpartycore.lib.api import api_server as api_v2
from counterpartycore.lib.api import api_v1 as api
from counterpartycore.test import util_test
Expand Down Expand Up @@ -595,6 +595,22 @@ def get_utxo_address_and_value(value):
def get_transaction_fee(db, transaction_type, block_index):
return 10

def determine_encoding(
data, desired_encoding="auto", op_return_max_size=config.OP_RETURN_MAX_SIZE
):
if desired_encoding == "auto":
if len(data) + len(config.PREFIX) <= op_return_max_size:
encoding = "opreturn"
else:
encoding = "multisig"
else:
encoding = desired_encoding

if encoding not in ("pubkeyhash", "multisig", "opreturn", "p2sh"):
raise exceptions.TransactionError("Unknown encoding‐scheme.")

return encoding

monkeypatch.setattr("counterpartycore.lib.transaction.arc4.init_arc4", init_arc4)
monkeypatch.setattr(
"counterpartycore.lib.backend.addrindexrs.get_unspent_txouts", get_unspent_txouts
Expand Down Expand Up @@ -637,3 +653,4 @@ def get_transaction_fee(db, transaction_type, block_index):
)

monkeypatch.setattr("counterpartycore.lib.gas.get_transaction_fee", get_transaction_fee)
monkeypatch.setattr("counterpartycore.lib.transaction.determine_encoding", determine_encoding)
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
],
None,
),
{"encoding": "singlesig", "regular_dust_size": DP["regular_dust_size"]},
{"encoding": "opreturn", "regular_dust_size": DP["regular_dust_size"]},
),
"error": (exceptions.TransactionError, "Destination output is dust."),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ Returns server information and the list of documented routes in JSON format.
"result": {
"server_ready": true,
"network": "mainnet",
"version": "10.4.1",
"version": "10.4.2",
"backend_height": 850214,
"counterparty_height": 850214,
"documentation": "https://counterpartycore.docs.apiary.io/",
Expand Down
2 changes: 1 addition & 1 deletion counterparty-core/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ python-gnupg==0.5.2
pyzmq==26.0.3
JSON-log-formatter==1.0
yoyo-migrations==8.2.0
counterparty-rs==10.4.1
counterparty-rs==10.4.2
2 changes: 1 addition & 1 deletion counterparty-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion counterparty-rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "counterparty-rs"
version = "10.4.1"
version = "10.4.2"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
5 changes: 4 additions & 1 deletion counterparty-rs/src/indexer/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@ where
stopper,
&mut operation,
error_message,
RetryConfig::default(),
RetryConfig {
timeout: Duration::MAX,
..RetryConfig::default()
},
)
}

Expand Down
2 changes: 1 addition & 1 deletion counterparty-wallet/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ colorlog==6.8.0
python-dateutil==2.8.2
requests==2.32.0
termcolor==2.4.0
counterparty-core==10.4.1
counterparty-core==10.4.2
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ x-addrindexrs-common: &addrindexrs-common
restart: unless-stopped

x-counterparty-common: &counterparty-common
image: counterparty/counterparty:v10.4.1
image: counterparty/counterparty:v10.4.2
stop_grace_period: 1m
volumes:
- data:/root/.bitcoin
Expand Down
26 changes: 16 additions & 10 deletions release-notes/release-notes-v10.4.2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Release Notes - Counterparty Core v10.4.2 (2024-??-??)
# 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

Expand All @@ -11,20 +15,22 @@

## Bugfixes

* Fix bytes JSON serialization in API v1
* Fix Docker Compose test
* Fix RSFetcher startup
* Fix API v1 regression (rename `unsigned_tx_hex` to `tx_hexh` in `create_*` result)
* Fix JSON serialization of bytes in API v1
* Restart RSFetcher when it stops
* 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

* No longer expire mempool entries after 24 hours
* Fetch old mempool entries from Bitcoin Core after node startup
* Expose timestamp field for "first seen in mempool" (for client-side filtering)
* 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

Expand Down

0 comments on commit 73272db

Please sign in to comment.