From ef9725b7b1c51e8e31567ead80cd592bb0e54e7b Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 20 Sep 2024 18:58:00 +0000 Subject: [PATCH 1/3] chore(release): 3.0.0-beta.1 [skip ci] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## [3.0.0-beta.1](https://github.com/hirosystems/ordhook/compare/v2.2.5...v3.0.0-beta.1) (2024-09-20) ### ⚠ BREAKING CHANGES * support brc20 activity on scan blocks command (#350) * keep original deployed ticker for brc20 tokens (#349) ### Features * add prometheus monitoring ([#356](https://github.com/hirosystems/ordhook/issues/356)) ([f35e1d0](https://github.com/hirosystems/ordhook/commit/f35e1d00e7940e31abcb8439b5b12a43be5023ea)) * keep original deployed ticker for brc20 tokens ([#349](https://github.com/hirosystems/ordhook/issues/349)) ([39774a9](https://github.com/hirosystems/ordhook/commit/39774a9f867d79932826f9d50d271ee1bf45c13d)) * support a separate storage directory for observers.sqlite ([#354](https://github.com/hirosystems/ordhook/issues/354)) ([7a65fdf](https://github.com/hirosystems/ordhook/commit/7a65fdf10728b7701cbcf7b83db92ec74d13535a)) * support brc20 activity on scan blocks command ([#350](https://github.com/hirosystems/ordhook/issues/350)) ([caacff7](https://github.com/hirosystems/ordhook/commit/caacff7c4f3d148b37232e04030814fa3ce3b30b)) * wait for bitcoind to be at chain tip before starting service ([#364](https://github.com/hirosystems/ordhook/issues/364)) ([d4b67bb](https://github.com/hirosystems/ordhook/commit/d4b67bb6f6ee16bac2add119f477ba42da824a98)) ### Bug Fixes * also check config when looking for brc20 db connection ([#347](https://github.com/hirosystems/ordhook/issues/347)) ([d80388b](https://github.com/hirosystems/ordhook/commit/d80388b505255117963a53206e41987e34551aaf)) * only create brc-20 db connection and cache if required ([#357](https://github.com/hirosystems/ordhook/issues/357)) ([5692426](https://github.com/hirosystems/ordhook/commit/5692426e4b85dde1fd7aefd01dd7f25a4f969fad)) --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6987eeda..93c530c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ +## [3.0.0-beta.1](https://github.com/hirosystems/ordhook/compare/v2.2.5...v3.0.0-beta.1) (2024-09-20) + + +### ⚠ BREAKING CHANGES + +* support brc20 activity on scan blocks command (#350) +* keep original deployed ticker for brc20 tokens (#349) + +### Features + +* add prometheus monitoring ([#356](https://github.com/hirosystems/ordhook/issues/356)) ([f35e1d0](https://github.com/hirosystems/ordhook/commit/f35e1d00e7940e31abcb8439b5b12a43be5023ea)) +* keep original deployed ticker for brc20 tokens ([#349](https://github.com/hirosystems/ordhook/issues/349)) ([39774a9](https://github.com/hirosystems/ordhook/commit/39774a9f867d79932826f9d50d271ee1bf45c13d)) +* support a separate storage directory for observers.sqlite ([#354](https://github.com/hirosystems/ordhook/issues/354)) ([7a65fdf](https://github.com/hirosystems/ordhook/commit/7a65fdf10728b7701cbcf7b83db92ec74d13535a)) +* support brc20 activity on scan blocks command ([#350](https://github.com/hirosystems/ordhook/issues/350)) ([caacff7](https://github.com/hirosystems/ordhook/commit/caacff7c4f3d148b37232e04030814fa3ce3b30b)) +* wait for bitcoind to be at chain tip before starting service ([#364](https://github.com/hirosystems/ordhook/issues/364)) ([d4b67bb](https://github.com/hirosystems/ordhook/commit/d4b67bb6f6ee16bac2add119f477ba42da824a98)) + + +### Bug Fixes + +* also check config when looking for brc20 db connection ([#347](https://github.com/hirosystems/ordhook/issues/347)) ([d80388b](https://github.com/hirosystems/ordhook/commit/d80388b505255117963a53206e41987e34551aaf)) +* only create brc-20 db connection and cache if required ([#357](https://github.com/hirosystems/ordhook/issues/357)) ([5692426](https://github.com/hirosystems/ordhook/commit/5692426e4b85dde1fd7aefd01dd7f25a4f969fad)) + ## [2.2.5](https://github.com/hirosystems/ordhook/compare/v2.2.4...v2.2.5) (2024-07-23) From f4e0c7935b825d2119d20c5acf08d289fe231423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20C=C3=A1rdenas?= Date: Mon, 23 Sep 2024 18:10:39 -0600 Subject: [PATCH 2/3] fix: roll back ordinals db changes when brc20 db commit fails (#367) --- .../processors/inscription_indexing.rs | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/components/ordhook-core/src/core/pipeline/processors/inscription_indexing.rs b/components/ordhook-core/src/core/pipeline/processors/inscription_indexing.rs index b84c87b0..d86259e0 100644 --- a/components/ordhook-core/src/core/pipeline/processors/inscription_indexing.rs +++ b/components/ordhook-core/src/core/pipeline/processors/inscription_indexing.rs @@ -42,8 +42,8 @@ use crate::{ blocks::open_blocks_db_with_retry, cursor::TransactionBytesCursor, ordinals::{ - get_any_entry_in_ordinal_activities, get_latest_indexed_inscription_number, - open_ordinals_db, open_ordinals_db_rw, + delete_inscriptions_in_block_range, get_any_entry_in_ordinal_activities, + get_latest_indexed_inscription_number, open_ordinals_db, open_ordinals_db_rw, }, }, service::write_brc20_block_operations, @@ -248,9 +248,22 @@ pub fn process_blocks( if let Some(brc20_db_tx) = brc20_db_tx { match brc20_db_tx.commit() { Ok(_) => {} - Err(_) => { - // TODO: Synchronize rollbacks and commits between BRC-20 and inscription DBs. - todo!() + Err(e) => { + // We will roll back the ordinals DB changes and panic so we can try the index again on next + // restart. + try_error!( + ctx, + "Unable to write BRC-20 index for block #{}: {}", + block.block_identifier.index, + e.to_string() + ); + delete_inscriptions_in_block_range( + block.block_identifier.index as u32, + block.block_identifier.index as u32, + inscriptions_db_conn_rw, + ctx, + ); + panic!("BRC-20 DB transaction commit failed"); } } } @@ -258,10 +271,11 @@ pub fn process_blocks( Err(e) => { try_error!( ctx, - "Unable to update changes in block #{}: {}", + "Unable to write index for block #{}: {}", block.block_identifier.index, e.to_string() ); + panic!("Ordinals DB transaction commit failed"); } } } From 1fbdcd9d5f8a17b6ee2d3d372028bdacd6fc9771 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 24 Sep 2024 00:16:08 +0000 Subject: [PATCH 3/3] chore(release): 3.0.0-beta.2 [skip ci] ## [3.0.0-beta.2](https://github.com/hirosystems/ordhook/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2024-09-24) ### Bug Fixes * roll back ordinals db changes when brc20 db commit fails ([#367](https://github.com/hirosystems/ordhook/issues/367)) ([f4e0c79](https://github.com/hirosystems/ordhook/commit/f4e0c7935b825d2119d20c5acf08d289fe231423)) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93c530c1..ea16cf6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [3.0.0-beta.2](https://github.com/hirosystems/ordhook/compare/v3.0.0-beta.1...v3.0.0-beta.2) (2024-09-24) + + +### Bug Fixes + +* roll back ordinals db changes when brc20 db commit fails ([#367](https://github.com/hirosystems/ordhook/issues/367)) ([f4e0c79](https://github.com/hirosystems/ordhook/commit/f4e0c7935b825d2119d20c5acf08d289fe231423)) + ## [3.0.0-beta.1](https://github.com/hirosystems/ordhook/compare/v2.2.5...v3.0.0-beta.1) (2024-09-20)