Skip to content

Commit

Permalink
Merge pull request #2406 from CounterpartyXCP/develop
Browse files Browse the repository at this point in the history
v10.4.8
  • Loading branch information
ouziel-slama authored Oct 17, 2024
2 parents 8890f8a + a571d1a commit 34d4436
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 12 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.7",
"version": "10.4.8",
"backend_height": 850214,
"counterparty_height": 850214,
"documentation": "https://counterpartycore.docs.apiary.io/",
Expand Down
10 changes: 8 additions & 2 deletions counterparty-core/counterpartycore/lib/api/api_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,12 @@ def update_assets_info(api_db, event):
"SELECT * FROM assets_info WHERE asset = :asset",
{"asset": event_bindings["asset"]},
)
if existing_asset is None and "asset_longname" in event_bindings:
existing_asset = fetch_one(
api_db,
"SELECT * FROM assets_info WHERE asset_longname = :asset_longname",
{"asset_longname": event_bindings["asset_longname"]},
)
if existing_asset is not None and not event_bindings["confirmed"]:
return
set_data = []
Expand Down Expand Up @@ -630,9 +636,9 @@ def update_fairminters(api_db, event):
def rollback_fairminters(api_db, event):
if event["event"] != "NEW_FAIRMINT":
return
if event["status"] != "valid":
return
event_bindings = json.loads(event["bindings"])
if event_bindings["status"] != "valid":
return
cursor = api_db.cursor()
sql = """
UPDATE fairminters SET
Expand Down
9 changes: 7 additions & 2 deletions counterparty-core/counterpartycore/lib/backend/bitcoind.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
TRANSACTIONS_CACHE_MAX_SIZE = 10000


def rpc_call(payload):
def rpc_call(payload, retry=0):
"""Calls to bitcoin core and returns the response"""
url = config.BACKEND_URL
response = None
Expand Down Expand Up @@ -89,10 +89,15 @@ def rpc_call(payload):
if response_json["error"]["code"] in [-28, -8, -2]:
# “Verifying blocks...” or “Block height out of range” or “The network does not appear to fully agree!“
logger.debug(f"Backend not ready. Sleeping for ten seconds. ({response_json['error']})")
logger.debug(f"Payload: {payload}")
if retry >= 10:
raise exceptions.BitcoindRPCError(
f"Backend not ready after {retry} retries. ({response_json['error']})"
)
# If Bitcoin Core takes more than `sys.getrecursionlimit() * 10 = 9970`
# seconds to start, this’ll hit the maximum recursion depth limit.
time.sleep(10)
return rpc_call(payload)
return rpc_call(payload, retry=retry + 1)
raise exceptions.BitcoindRPCError(response_json["error"]["message"])


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.7" # for hatch
__version__ = "10.4.8" # for hatch
VERSION_STRING = __version__
version = VERSION_STRING.split("-")[0].split(".")
VERSION_MAJOR = int(version[0])
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.7",
"version": "10.4.8",
"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 @@ -34,4 +34,4 @@ JSON-log-formatter==1.0
yoyo-migrations==8.2.0
gunicorn==23.0.0
waitress==3.0.0
counterparty-rs==10.4.7
counterparty-rs==10.4.8
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.7"
version = "10.4.8"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
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.7
counterparty-core==10.4.8
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.7
image: counterparty/counterparty:v10.4.8
stop_grace_period: 1m
volumes:
- data:/root/.bitcoin
Expand Down
30 changes: 30 additions & 0 deletions release-notes/release-notes-v10.4.8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Release Notes - Counterparty Core v10.4.8 (2024-10-17)

This is a hotfix release to fix a number of additional issues that arose with the recent protocol changes.

# Upgrading

This is not a protocol change, and no database reparsing is necessary.


# ChangeLog

## Bugfixes

- Fix fair minting rollback
- Fix API server crash due to missing sanity check
- Retry maximum 10 times on Bitcoin Core RPC call error

## Codebase

## API

## CLI



# Credits

* Ouziel Slama
* Warren Puffett
* Adam Krellenstein

0 comments on commit 34d4436

Please sign in to comment.