Skip to content

Commit abf1c0a

Browse files
committed
Fix block processing mutex logic.
1 parent b72636f commit abf1c0a

File tree

31 files changed

+61
-60
lines changed

31 files changed

+61
-60
lines changed

Cargo.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_docker/compose/.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=0.24.13
1+
VERSION=0.24.14
22
ENV=production
33
LOG_LEVEL=debug
44

subvt-app-service/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-app-service"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

subvt-block-processor/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-block-processor"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

subvt-block-processor/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -663,10 +663,10 @@ impl BlockProcessor {
663663
log::debug!("RELAY Busy processing past blocks. Skip block #{finalized_block_number} for now.");
664664
return Ok(());
665665
}
666+
RELAY_IS_BUSY.store(true, Ordering::SeqCst);
666667
let block_processor_substrate_client = relay_substrate_client.clone();
667668
let asset_hub_substrate_client = asset_hub_substrate_client.clone();
668669
let postgres = postgres.clone();
669-
RELAY_IS_BUSY.store(true, Ordering::SeqCst);
670670
tokio::spawn(async move {
671671
let mut block_processor_substrate_client = block_processor_substrate_client.lock().await;
672672
let mut asset_hub_substrate_client = asset_hub_substrate_client.lock().await;
@@ -810,11 +810,11 @@ impl BlockProcessor {
810810
log::debug!("ASSET_HUB Busy processing past blocks. Skip block #{finalized_block_number} for now.");
811811
return Ok(());
812812
}
813+
ASSET_HUB_IS_BUSY.store(true, Ordering::SeqCst);
813814
let block_processor_substrate_client = substrate_client.clone();
814815
let relay_substrate_client = relay_substrate_client.clone();
815816
let postgres = postgres.clone();
816817
let runtime_information = runtime_information.clone();
817-
ASSET_HUB_IS_BUSY.store(true, Ordering::SeqCst);
818818
tokio::spawn(async move {
819819
let mut block_processor_substrate_client = block_processor_substrate_client.lock().await;
820820
let mut relay_substrate_client = relay_substrate_client.lock().await;
@@ -827,6 +827,7 @@ impl BlockProcessor {
827827
return;
828828
}
829829
};
830+
log::info!("Processed block {processed_block_height}, finalized block {finalized_block_number}.");
830831
if processed_block_height < (finalized_block_number - 1) {
831832
let mut block_number = std::cmp::max(
832833
processed_block_height,
@@ -864,7 +865,7 @@ impl BlockProcessor {
864865
} else {
865866
// update current era reward points every 3 minutes
866867
let blocks_per_3_minutes = 3 * 60 * 1000
867-
/ get_metadata_expected_block_time_millis(&block_processor_substrate_client.metadata).unwrap();
868+
/ get_metadata_expected_block_time_millis(&relay_substrate_client.metadata).unwrap();
868869
log::info!("ASSET_HUB Process block #{finalized_block_number}.");
869870
let start = std::time::Instant::now();
870871
let update_result = self.process_asset_hub_block(

subvt-config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-config"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

subvt-governance/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-governance"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

subvt-kline-updater/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-kline-updater"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

subvt-logging/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-logging"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

subvt-metrics/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "subvt-metrics"
3-
version = "0.24.13"
3+
version = "0.24.14"
44
edition = "2021"
55
rust-version = "1.67.0"
66

0 commit comments

Comments
 (0)