From 10cbf81bedf1c4aca47f11e5edddaa20bc133bbd Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 13:12:17 +0000 Subject: [PATCH 01/16] check if rollback is needed on revision bump --- counterparty-core/counterpartycore/lib/check.py | 1 + 1 file changed, 1 insertion(+) diff --git a/counterparty-core/counterpartycore/lib/check.py b/counterparty-core/counterpartycore/lib/check.py index 412fc0f89f..a4c0840e72 100644 --- a/counterparty-core/counterpartycore/lib/check.py +++ b/counterparty-core/counterpartycore/lib/check.py @@ -1115,4 +1115,5 @@ def database_version(db): else: message = f"Client pre-release version number mismatch: {version_pre_release} ≠ {config.VERSION_PRE_RELEASE}. " message += "Checking if a reparse is needed..." + check_need_rollback(version_minor, message) check_need_reparse(version_minor, message) From d1631c6ef69d96bdb50dd6d9607a3f444c76f2e3 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 14:41:36 +0000 Subject: [PATCH 02/16] typo --- counterparty-core/counterpartycore/lib/check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/counterparty-core/counterpartycore/lib/check.py b/counterparty-core/counterpartycore/lib/check.py index a4c0840e72..d9a682b6d0 100644 --- a/counterparty-core/counterpartycore/lib/check.py +++ b/counterparty-core/counterpartycore/lib/check.py @@ -1114,6 +1114,6 @@ def database_version(db): message = "`VERSION_STRING` not found in dataase. " else: message = f"Client pre-release version number mismatch: {version_pre_release} ≠ {config.VERSION_PRE_RELEASE}. " - message += "Checking if a reparse is needed..." + message += "Checking if a rollback or a reparse is needed..." check_need_rollback(version_minor, message) check_need_reparse(version_minor, message) From 1363dfb901fe8a8318124d4b465c45aa4e1dd28d Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 15:04:15 +0000 Subject: [PATCH 03/16] Revert "Tweak Logging" This reverts commit 7c5b89c8ebb00cb422a08bf82b18628c911e3a40. --- .../counterpartycore/lib/backend/bitcoind.py | 22 +++++++------------ .../counterpartycore/lib/mempool.py | 10 ++++----- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/backend/bitcoind.py b/counterparty-core/counterpartycore/lib/backend/bitcoind.py index 376306a772..da1744b6a9 100644 --- a/counterparty-core/counterpartycore/lib/backend/bitcoind.py +++ b/counterparty-core/counterpartycore/lib/backend/bitcoind.py @@ -22,7 +22,6 @@ def rpc_call(payload, retry=0): """Calls to bitcoin core and returns the response""" url = config.BACKEND_URL response = None - start_time = time.time() tries = 0 broken_error = None @@ -79,15 +78,15 @@ def rpc_call(payload, retry=0): # Batch query returns a list if isinstance(response_json, list): - result = response_json - elif "error" not in response_json.keys() or response_json["error"] is None: # noqa: E711 - result = response_json["result"] - elif response_json["error"]["code"] == -5: # RPC_INVALID_ADDRESS_OR_KEY + return response_json + if "error" not in response_json.keys() or response_json["error"] is None: # noqa: E711 + return response_json["result"] + if response_json["error"]["code"] == -5: # RPC_INVALID_ADDRESS_OR_KEY raise exceptions.BitcoindRPCError( f"{response_json['error']} Is `txindex` enabled in {config.BTC_NAME} Core?" ) - elif 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!" + 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: @@ -95,15 +94,10 @@ def rpc_call(payload, retry=0): 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. + # seconds to start, this’ll hit the maximum recursion depth limit. time.sleep(10) return rpc_call(payload, retry=retry + 1) - else: - raise exceptions.BitcoindRPCError(response_json["error"]["message"]) - - elapsed = time.time() - start_time - logger.trace(f"Bitcoin Core RPC call {payload['method']} took {elapsed:.3f}s") - return result + raise exceptions.BitcoindRPCError(response_json["error"]["message"]) def rpc(method, params): diff --git a/counterparty-core/counterpartycore/lib/mempool.py b/counterparty-core/counterpartycore/lib/mempool.py index 65f4692711..2b8152b4d4 100644 --- a/counterparty-core/counterpartycore/lib/mempool.py +++ b/counterparty-core/counterpartycore/lib/mempool.py @@ -78,7 +78,7 @@ def parse_mempool_transactions(db, raw_tx_list, timestamps=None): # save the events in memory transaction_events = cursor.fetchall() # we raise an exception to rollback the transaction - raise exceptions.MempoolError("Mempool transaction parsed successfully.") + raise exceptions.MempoolError("Mempool transaction parsed successfully") except exceptions.MempoolError: # save events in the mempool table for event in transaction_events: @@ -103,7 +103,7 @@ def parse_mempool_transactions(db, raw_tx_list, timestamps=None): )""", event, ) - logger.trace("Mempool transaction parsed successfully.") + logger.trace("Mempool transaction parsed successfully") util.PARSING_MEMPOOL = False @@ -130,7 +130,7 @@ def parse_raw_mempool(db): raw_tx_list = [] timestamps = {} cursor = db.cursor() - logger.debug(f"Found {len(raw_mempool)} transaction(s) in the mempool...") + logger.debug(f"{len(raw_mempool)} transaction(s) in the mempool...") for txid, tx_info in raw_mempool.items(): existing_tx_in_mempool = cursor.execute( "SELECT * FROM mempool WHERE tx_hash = ? LIMIT 1", (txid,) @@ -138,7 +138,7 @@ def parse_raw_mempool(db): if existing_tx_in_mempool: continue try: - logger.trace(f"Getting raw transaction `{txid}` from the mempool...") + logger.trace(f"Getting raw transaction {txid} from the mempool...") raw_tx = backend.bitcoind.getrawtransaction(txid) raw_tx_list.append(raw_tx) timestamps[txid] = tx_info["time"] @@ -149,4 +149,4 @@ def parse_raw_mempool(db): raise e logger.debug(f"Parsing {len(raw_tx_list)} transaction(s) from the mempool...") parse_mempool_transactions(db, raw_tx_list, timestamps) - logger.debug("Raw mempool parsed successfully.") + logger.debug("Raw mempool parsed successfully") From 26fab5635b39088ccdb3ed50f36c15a20e6dd909 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 15:34:28 +0000 Subject: [PATCH 04/16] fix logging and regtest --- .../counterpartycore/lib/api/api_server.py | 3 ++ .../counterpartycore/lib/backend/bitcoind.py | 29 ++++++++++++++----- .../counterpartycore/lib/mempool.py | 10 +++---- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/api/api_server.py b/counterparty-core/counterpartycore/lib/api/api_server.py index 1c0b851116..caf60571a2 100644 --- a/counterparty-core/counterpartycore/lib/api/api_server.py +++ b/counterparty-core/counterpartycore/lib/api/api_server.py @@ -363,6 +363,9 @@ def handle_route(**kwargs): except Exception as e: capture_exception(e) logger.error("Error in API: %s", e) + import traceback + + print(traceback.format_exc()) return return_result( 503, error="Unknown error", start_time=start_time, query_args=query_args ) diff --git a/counterparty-core/counterpartycore/lib/backend/bitcoind.py b/counterparty-core/counterpartycore/lib/backend/bitcoind.py index da1744b6a9..2d3551fb3e 100644 --- a/counterparty-core/counterpartycore/lib/backend/bitcoind.py +++ b/counterparty-core/counterpartycore/lib/backend/bitcoind.py @@ -22,6 +22,7 @@ def rpc_call(payload, retry=0): """Calls to bitcoin core and returns the response""" url = config.BACKEND_URL response = None + start_time = time.time() tries = 0 broken_error = None @@ -78,15 +79,15 @@ def rpc_call(payload, retry=0): # Batch query returns a list if isinstance(response_json, list): - return response_json - if "error" not in response_json.keys() or response_json["error"] is None: # noqa: E711 - return response_json["result"] - if response_json["error"]["code"] == -5: # RPC_INVALID_ADDRESS_OR_KEY + result = response_json + elif "error" not in response_json.keys() or response_json["error"] is None: # noqa: E711 + result = response_json["result"] + elif response_json["error"]["code"] == -5: # RPC_INVALID_ADDRESS_OR_KEY raise exceptions.BitcoindRPCError( f"{response_json['error']} Is `txindex` enabled in {config.BTC_NAME} Core?" ) - 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!“ + elif 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: @@ -94,10 +95,22 @@ def rpc_call(payload, retry=0): 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. + # seconds to start, this'll hit the maximum recursion depth limit. time.sleep(10) return rpc_call(payload, retry=retry + 1) - raise exceptions.BitcoindRPCError(response_json["error"]["message"]) + else: + raise exceptions.BitcoindRPCError(response_json["error"]["message"]) + + if isinstance(payload, dict): + method = payload["method"] + elif isinstance(payload, list): + method = payload[0]["method"] + else: + method = "unknown" + elapsed = time.time() - start_time + logger.trace(f"Bitcoin Core RPC call {method} took {elapsed:.3f}s") + + return result def rpc(method, params): diff --git a/counterparty-core/counterpartycore/lib/mempool.py b/counterparty-core/counterpartycore/lib/mempool.py index 2b8152b4d4..65f4692711 100644 --- a/counterparty-core/counterpartycore/lib/mempool.py +++ b/counterparty-core/counterpartycore/lib/mempool.py @@ -78,7 +78,7 @@ def parse_mempool_transactions(db, raw_tx_list, timestamps=None): # save the events in memory transaction_events = cursor.fetchall() # we raise an exception to rollback the transaction - raise exceptions.MempoolError("Mempool transaction parsed successfully") + raise exceptions.MempoolError("Mempool transaction parsed successfully.") except exceptions.MempoolError: # save events in the mempool table for event in transaction_events: @@ -103,7 +103,7 @@ def parse_mempool_transactions(db, raw_tx_list, timestamps=None): )""", event, ) - logger.trace("Mempool transaction parsed successfully") + logger.trace("Mempool transaction parsed successfully.") util.PARSING_MEMPOOL = False @@ -130,7 +130,7 @@ def parse_raw_mempool(db): raw_tx_list = [] timestamps = {} cursor = db.cursor() - logger.debug(f"{len(raw_mempool)} transaction(s) in the mempool...") + logger.debug(f"Found {len(raw_mempool)} transaction(s) in the mempool...") for txid, tx_info in raw_mempool.items(): existing_tx_in_mempool = cursor.execute( "SELECT * FROM mempool WHERE tx_hash = ? LIMIT 1", (txid,) @@ -138,7 +138,7 @@ def parse_raw_mempool(db): if existing_tx_in_mempool: continue try: - logger.trace(f"Getting raw transaction {txid} from the mempool...") + logger.trace(f"Getting raw transaction `{txid}` from the mempool...") raw_tx = backend.bitcoind.getrawtransaction(txid) raw_tx_list.append(raw_tx) timestamps[txid] = tx_info["time"] @@ -149,4 +149,4 @@ def parse_raw_mempool(db): raise e logger.debug(f"Parsing {len(raw_tx_list)} transaction(s) from the mempool...") parse_mempool_transactions(db, raw_tx_list, timestamps) - logger.debug("Raw mempool parsed successfully") + logger.debug("Raw mempool parsed successfully.") From bb2448a1fd6a56286c174d0d4d7146237cb222be Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 15:54:37 +0000 Subject: [PATCH 05/16] Get transaction by batch when parsing mempoool --- .../counterpartycore/lib/mempool.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/mempool.py b/counterparty-core/counterpartycore/lib/mempool.py index 65f4692711..29f28139a7 100644 --- a/counterparty-core/counterpartycore/lib/mempool.py +++ b/counterparty-core/counterpartycore/lib/mempool.py @@ -131,22 +131,22 @@ def parse_raw_mempool(db): timestamps = {} cursor = db.cursor() logger.debug(f"Found {len(raw_mempool)} transaction(s) in the mempool...") + txhash_list = [] for txid, tx_info in raw_mempool.items(): existing_tx_in_mempool = cursor.execute( "SELECT * FROM mempool WHERE tx_hash = ? LIMIT 1", (txid,) ).fetchone() if existing_tx_in_mempool: continue - try: - logger.trace(f"Getting raw transaction `{txid}` from the mempool...") - raw_tx = backend.bitcoind.getrawtransaction(txid) - raw_tx_list.append(raw_tx) - timestamps[txid] = tx_info["time"] - except exceptions.BitcoindRPCError as e: - if "No such mempool or blockchain transaction" in str(e): - pass - else: - raise e + txhash_list.append(txid) + timestamps[txid] = tx_info["time"] + + logger.debug(f"Getting {len(raw_tx_list)} raw transactions by batch from the mempool...") + raw_transactions_by_hash = backend.addrindexrs.getrawtransaction_batch( + txhash_list, skip_missing=True + ) + raw_tx_list = raw_transactions_by_hash.values() + logger.debug(f"Parsing {len(raw_tx_list)} transaction(s) from the mempool...") parse_mempool_transactions(db, raw_tx_list, timestamps) logger.debug("Raw mempool parsed successfully.") From b4467bb831adcd0d366f50fb27909151ea88d636 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 16:25:54 +0000 Subject: [PATCH 06/16] clean missing tx --- counterparty-core/counterpartycore/lib/mempool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/mempool.py b/counterparty-core/counterpartycore/lib/mempool.py index 29f28139a7..909fdfafcc 100644 --- a/counterparty-core/counterpartycore/lib/mempool.py +++ b/counterparty-core/counterpartycore/lib/mempool.py @@ -141,11 +141,11 @@ def parse_raw_mempool(db): txhash_list.append(txid) timestamps[txid] = tx_info["time"] - logger.debug(f"Getting {len(raw_tx_list)} raw transactions by batch from the mempool...") + logger.debug(f"Getting {len(txhash_list)} raw transactions by batch from the mempool...") raw_transactions_by_hash = backend.addrindexrs.getrawtransaction_batch( txhash_list, skip_missing=True ) - raw_tx_list = raw_transactions_by_hash.values() + raw_tx_list = [raw_hex for raw_hex in raw_transactions_by_hash.values() if raw_hex is not None] logger.debug(f"Parsing {len(raw_tx_list)} transaction(s) from the mempool...") parse_mempool_transactions(db, raw_tx_list, timestamps) From 80315357acf71719a9f2ac5f9f3c7c6d02b3a98e Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 16:27:08 +0000 Subject: [PATCH 07/16] Update release notes --- release-notes/release-notes-v10.8.0.md | 1 + 1 file changed, 1 insertion(+) diff --git a/release-notes/release-notes-v10.8.0.md b/release-notes/release-notes-v10.8.0.md index 1e96a5bee7..cd357ad117 100644 --- a/release-notes/release-notes-v10.8.0.md +++ b/release-notes/release-notes-v10.8.0.md @@ -47,6 +47,7 @@ This upgrade requires a mandatory, automatic reparse from block 871780. - Exclude transactions by `SIGHASH` - Be able to trigger a rollback on a minor version change - Add several new checkpoints +- Parse raw mempool by batch before following ## API From 9af531d72566c7124e9d27328c3a2ce831fc1d87 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 16:36:34 +0000 Subject: [PATCH 08/16] set BACKEND_RAW_TRANSACTIONS_CACHE_SIZE to 1000 --- counterparty-core/counterpartycore/lib/config.py | 2 +- release-notes/release-notes-v10.8.0.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/counterparty-core/counterpartycore/lib/config.py b/counterparty-core/counterpartycore/lib/config.py index ff0f656ddd..3090c2bb5d 100644 --- a/counterparty-core/counterpartycore/lib/config.py +++ b/counterparty-core/counterpartycore/lib/config.py @@ -155,7 +155,7 @@ # Custom exit codes EXITCODE_UPDATE_REQUIRED = 5 -BACKEND_RAW_TRANSACTIONS_CACHE_SIZE = 20000 +BACKEND_RAW_TRANSACTIONS_CACHE_SIZE = 1000 BACKEND_RPC_BATCH_NUM_WORKERS = 6 DEFAULT_UTXO_LOCKS_MAX_ADDRESSES = 1000 diff --git a/release-notes/release-notes-v10.8.0.md b/release-notes/release-notes-v10.8.0.md index cd357ad117..05b4f3eb97 100644 --- a/release-notes/release-notes-v10.8.0.md +++ b/release-notes/release-notes-v10.8.0.md @@ -48,6 +48,7 @@ This upgrade requires a mandatory, automatic reparse from block 871780. - Be able to trigger a rollback on a minor version change - Add several new checkpoints - Parse raw mempool by batch before following +- Set `BACKEND_RAW_TRANSACTIONS_CACHE_SIZE` to 1000 ## API From 8f7e6594c2fbba90e99a3f5ae901ea980cf5158f Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Fri, 13 Dec 2024 16:41:58 +0000 Subject: [PATCH 09/16] clean debug --- counterparty-core/counterpartycore/lib/api/api_server.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/counterparty-core/counterpartycore/lib/api/api_server.py b/counterparty-core/counterpartycore/lib/api/api_server.py index caf60571a2..9ec3d6854f 100644 --- a/counterparty-core/counterpartycore/lib/api/api_server.py +++ b/counterparty-core/counterpartycore/lib/api/api_server.py @@ -363,9 +363,8 @@ def handle_route(**kwargs): except Exception as e: capture_exception(e) logger.error("Error in API: %s", e) - import traceback - - print(traceback.format_exc()) + # import traceback + # print(traceback.format_exc()) return return_result( 503, error="Unknown error", start_time=start_time, query_args=query_args ) From bfc1d8f0c778e9d31e2d3e5ac1fd4db50515d866 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 14:04:06 +0000 Subject: [PATCH 10/16] Fix utxo balances cache --- counterparty-core/counterpartycore/lib/gettxinfo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/counterparty-core/counterpartycore/lib/gettxinfo.py b/counterparty-core/counterpartycore/lib/gettxinfo.py index 2eae2f109d..9c7b18a218 100644 --- a/counterparty-core/counterpartycore/lib/gettxinfo.py +++ b/counterparty-core/counterpartycore/lib/gettxinfo.py @@ -741,7 +741,8 @@ def get_op_return_vout(decoded_tx): KNOWN_SOURCES = { - "92ad58f5aa35c503489efbdd2a466e942baa9ac5cd67cb7544adf03e47a457d0": "a71da7169db3672408c7b25f84be425839548e63fa480c0478f91e3c2aa3ec67:0" + "92ad58f5aa35c503489efbdd2a466e942baa9ac5cd67cb7544adf03e47a457d0": "a71da7169db3672408c7b25f84be425839548e63fa480c0478f91e3c2aa3ec67:0", + "c80143886181ebbc782d23a50acca0f5ea7ac005d3164d7c76fc5e14f72d47c8": "", } From 17868c33b794d3370c2844c9e20d7387a165e2f2 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 14:30:37 +0000 Subject: [PATCH 11/16] Bump version --- apiary.apib | 2 +- counterparty-core/counterpartycore/lib/backend/addrindexrs.py | 4 ++++ counterparty-core/counterpartycore/lib/config.py | 2 +- .../test/regtest/apidoc/blueprint-template.md | 2 +- counterparty-core/requirements.txt | 2 +- counterparty-rs/Cargo.lock | 2 +- counterparty-rs/Cargo.toml | 2 +- counterparty-wallet/requirements.txt | 2 +- docker-compose.yml | 2 +- 9 files changed, 12 insertions(+), 8 deletions(-) diff --git a/apiary.apib b/apiary.apib index da8ebaf086..da13d18863 100644 --- a/apiary.apib +++ b/apiary.apib @@ -1456,7 +1456,7 @@ Returns server information and the list of documented routes in JSON format. "result": { "server_ready": true, "network": "mainnet", - "version": "10.8.0-rc.2", + "version": "10.8.0", "backend_height": 850214, "counterparty_height": 850214, "documentation": "https://counterpartycore.docs.apiary.io/", diff --git a/counterparty-core/counterpartycore/lib/backend/addrindexrs.py b/counterparty-core/counterpartycore/lib/backend/addrindexrs.py index 08e84e679c..fa2d6031ba 100644 --- a/counterparty-core/counterpartycore/lib/backend/addrindexrs.py +++ b/counterparty-core/counterpartycore/lib/backend/addrindexrs.py @@ -692,6 +692,10 @@ def get_oldest_tx(self, address, block_index, timeout=ADDRINDEXRS_CLIENT_TIMEOUT "block_index": 820321, "tx_hash": "b61ac3ab1ba9d63d484e8f83e8b9607bd932c8f4b742095445c3527ab575d972", }, # {} + "842375-bc1q2rn0c89mylzj6c26exda5y2nkezmzh4lh5rkkl": { + "block_index": 842374, + "tx_hash": "3043db292b7f64cbe1cafa32bc733316b162d8a1f41f31a1e6cd224fd5b72415", + }, } ADDRINDEXRS_CLIENT = None diff --git a/counterparty-core/counterpartycore/lib/config.py b/counterparty-core/counterpartycore/lib/config.py index 3090c2bb5d..300a8bf12e 100644 --- a/counterparty-core/counterpartycore/lib/config.py +++ b/counterparty-core/counterpartycore/lib/config.py @@ -5,7 +5,7 @@ # Semantic Version -__version__ = "10.8.0-rc.2" # for hatch +__version__ = "10.8.0" # for hatch VERSION_STRING = __version__ version = VERSION_STRING.split("-")[0].split(".") VERSION_MAJOR = int(version[0]) diff --git a/counterparty-core/counterpartycore/test/regtest/apidoc/blueprint-template.md b/counterparty-core/counterpartycore/test/regtest/apidoc/blueprint-template.md index 5ae6214d8c..f0531fe2de 100644 --- a/counterparty-core/counterpartycore/test/regtest/apidoc/blueprint-template.md +++ b/counterparty-core/counterpartycore/test/regtest/apidoc/blueprint-template.md @@ -165,7 +165,7 @@ Returns server information and the list of documented routes in JSON format. "result": { "server_ready": true, "network": "mainnet", - "version": "10.8.0-rc.2", + "version": "10.8.0", "backend_height": 850214, "counterparty_height": 850214, "documentation": "https://counterpartycore.docs.apiary.io/", diff --git a/counterparty-core/requirements.txt b/counterparty-core/requirements.txt index d85df46ed7..a7f36ff46a 100644 --- a/counterparty-core/requirements.txt +++ b/counterparty-core/requirements.txt @@ -36,4 +36,4 @@ gunicorn==23.0.0 waitress==3.0.1 hypothesis==6.116.0 bitcoin-utils==0.7.1 -counterparty-rs==10.8.0-rc.2 +counterparty-rs==10.8.0 diff --git a/counterparty-rs/Cargo.lock b/counterparty-rs/Cargo.lock index 3d224c55aa..1ebfe31532 100644 --- a/counterparty-rs/Cargo.lock +++ b/counterparty-rs/Cargo.lock @@ -394,7 +394,7 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "counterparty-rs" -version = "10.8.0-rc.2" +version = "10.8.0" dependencies = [ "bip32", "bitcoin", diff --git a/counterparty-rs/Cargo.toml b/counterparty-rs/Cargo.toml index 3154735637..4a8753548c 100644 --- a/counterparty-rs/Cargo.toml +++ b/counterparty-rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "counterparty-rs" -version = "10.8.0-rc.2" +version = "10.8.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/counterparty-wallet/requirements.txt b/counterparty-wallet/requirements.txt index 27c6f0a661..6c51606c7d 100644 --- a/counterparty-wallet/requirements.txt +++ b/counterparty-wallet/requirements.txt @@ -5,4 +5,4 @@ colorlog==6.8.0 python-dateutil==2.8.2 requests==2.32.0 termcolor==2.4.0 -counterparty-core==10.8.0-rc.2 +counterparty-core==10.8.0 diff --git a/docker-compose.yml b/docker-compose.yml index e1038d40c3..0d9bc2d150 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ x-addrindexrs-common: &addrindexrs-common restart: unless-stopped x-counterparty-common: &counterparty-common - image: counterparty/counterparty:v10.8.0-rc.2 + image: counterparty/counterparty:v10.8.0 stop_grace_period: 1m volumes: - data:/root/.bitcoin From f832406fe80d1ece4e3dddcd6566625905b271cd Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 14:37:19 +0000 Subject: [PATCH 12/16] Fix typo; Disable temporary docker compose --- .github/workflows/test_compose.sh | 2 +- release-notes/release-notes-v10.8.0.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_compose.sh b/.github/workflows/test_compose.sh index 5ab69742db..decb3d9111 100644 --- a/.github/workflows/test_compose.sh +++ b/.github/workflows/test_compose.sh @@ -3,7 +3,7 @@ set -e set -x -#exit 0 +exit 0 export PATH="/snap/bin:$PATH" diff --git a/release-notes/release-notes-v10.8.0.md b/release-notes/release-notes-v10.8.0.md index 05b4f3eb97..7acc4bcdb7 100644 --- a/release-notes/release-notes-v10.8.0.md +++ b/release-notes/release-notes-v10.8.0.md @@ -5,7 +5,7 @@ This release includes some significant architectural changes to the codebase to # Upgrading -This upgrade requires a mandatory, automatic reparse from block 871780. +This upgrade requires a mandatory, automatic rollback from block 871780. # ChangeLog From 6afe603f7cf0ae8bdbc438a48c209123515afbe7 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 14:45:03 +0000 Subject: [PATCH 13/16] disable docker compose test --- .github/workflows/test_compose.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/test_compose.yml diff --git a/.github/workflows/test_compose.yml b/.github/workflows/test_compose.yml deleted file mode 100644 index af016b5c87..0000000000 --- a/.github/workflows/test_compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Docker Compose - -on: - push: - branches: ['develop', 'master', 'preprelease'] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Get branch names. - id: branch-names - uses: tj-actions/branch-names@v8 - - uses: alinz/ssh-scp-action@master - with: - key: ${{ secrets.TEST_SERVER_KEY }} - host: ${{ secrets.TEST_SERVER_IP }} - user: ${{ secrets.TEST_SERVER_USER }} - ssh_before: | - rm -f test_compose.sh - scp: | - .github/workflows/test_compose.sh ${{ secrets.TEST_SERVER_USER }}@${{ secrets.TEST_SERVER_IP }}:~/test_compose.sh - ssh_after: | - sh test_compose.sh ${{ steps.branch-names.outputs.current_branch }} From ac3f4d2e979f5741d88dc6e0fdc01553a824c84c Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 16:39:23 +0000 Subject: [PATCH 14/16] Add checkpoint --- counterparty-core/counterpartycore/lib/check.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/counterparty-core/counterpartycore/lib/check.py b/counterparty-core/counterpartycore/lib/check.py index d9a682b6d0..28410f317f 100644 --- a/counterparty-core/counterpartycore/lib/check.py +++ b/counterparty-core/counterpartycore/lib/check.py @@ -691,6 +691,10 @@ "ledger_hash": "8e55b64d0dfd85a58e3a9dd27ce49efd98559d96f16f53beb66a10b7671ea857", "txlist_hash": "b3f549168f56702287c7b06c0348c4ac0adffcd219bab386d2f19326c0cd491c", }, + 874883: { + "ledger_hash": "4c4d6b660af23bb03a04bbf93ddd0a4b8e615dd7b883ecf827274cabe658bfc2", + "txlist_hash": "f6a99d60337c33c1822c048f56e241455cd7e45bb5a9515096f1ac609d50f669", + }, } CONSENSUS_HASH_VERSION_TESTNET = 7 From 0891688f6718c441fd5f6adb383af6008137e14b Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 17:06:39 +0000 Subject: [PATCH 15/16] Fix bootstrap --- counterparty-core/counterpartycore/server.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/counterparty-core/counterpartycore/server.py b/counterparty-core/counterpartycore/server.py index 7b0c51d8a7..235d245d99 100755 --- a/counterparty-core/counterpartycore/server.py +++ b/counterparty-core/counterpartycore/server.py @@ -988,13 +988,18 @@ def bootstrap(no_confirm=False, snapshot_url=None): if config.TESTNET: ledger_database_path += ".testnet" ledger_database_path += ".db" - api_database_path = ledger_database_path.replace(".db", ".api.db") + + old_api_database_path = ledger_database_path.replace(".db", ".api.db") + if config.TESTNET: + api_database_path = os.path.join(config.DATA_DIR, "state.testnet.db") + else: + api_database_path = os.path.join(config.DATA_DIR, "state.db") # Prepare Directory. if not os.path.exists(config.DATA_DIR): os.makedirs(config.DATA_DIR, mode=0o755) - for database_path in [ledger_database_path, api_database_path]: + for database_path in [ledger_database_path, api_database_path, old_api_database_path]: if os.path.exists(database_path): os.remove(database_path) # Delete SQLite Write-Ahead-Log From 6d115cbf30c40bb97aae3f6166c9f679abdcc102 Mon Sep 17 00:00:00 2001 From: Ouziel Slama Date: Sun, 15 Dec 2024 17:22:28 +0000 Subject: [PATCH 16/16] fix testnet test book --- counterparty-core/counterpartycore/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/counterparty-core/counterpartycore/server.py b/counterparty-core/counterpartycore/server.py index 235d245d99..087c3358f3 100755 --- a/counterparty-core/counterpartycore/server.py +++ b/counterparty-core/counterpartycore/server.py @@ -1042,10 +1042,13 @@ def bootstrap_progress(blocknum, blocksize, totalsize): tar_file.extractall(path=config.DATA_DIR) # nosec B202 # noqa: S202 assert os.path.exists(ledger_database_path) - assert os.path.exists(api_database_path) + assert os.path.exists(api_database_path) or os.path.exists(old_api_database_path) # user and group have "rw" access os.chmod(ledger_database_path, 0o660) # nosec B103 - os.chmod(api_database_path, 0o660) # nosec B103 + if os.path.exists(api_database_path): + os.chmod(api_database_path, 0o660) # nosec B103 + if os.path.exists(old_api_database_path): + os.chmod(old_api_database_path, 0o660) # nosec B103 with log.Spinner("Cleaning up..."): os.remove(tarball_path)