From 8a020f9434a614666acb857c56878a9b509ee9f0 Mon Sep 17 00:00:00 2001 From: Jack Huang Date: Mon, 9 Dec 2024 12:17:57 +0800 Subject: [PATCH] remove sync block in store before executing the dag block (#4331) * remove sync block in store before executing the dag block * remove sync db when restarting --- kube/manifest/starcoin-vega.yaml | 2 +- sync/src/tasks/block_sync_task.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kube/manifest/starcoin-vega.yaml b/kube/manifest/starcoin-vega.yaml index 9e23dc8a2c..f2f5a7f1c5 100644 --- a/kube/manifest/starcoin-vega.yaml +++ b/kube/manifest/starcoin-vega.yaml @@ -28,7 +28,7 @@ spec: - -c args: - - rm -rf /sc-data/vega/starcoin.ipc /sc-data/vega/starcoindb/db/starcoindb/LOCK /sc-data/vega/genesis_config.json; + rm -rf /sc-data/vega/sync /sc-data/vega/starcoin.ipc /sc-data/vega/starcoindb/db/starcoindb/LOCK /sc-data/vega/genesis_config.json; id=$(echo -e $POD_NAME|awk -F'-' '{print $2}') && IFS='; ' read -r -a node_keys <<< $NODE_KEYS && node_key=${node_keys[$id]}; if [ ! -z $node_key ]; then diff --git a/sync/src/tasks/block_sync_task.rs b/sync/src/tasks/block_sync_task.rs index 1f83b1b344..e68ae73db8 100644 --- a/sync/src/tasks/block_sync_task.rs +++ b/sync/src/tasks/block_sync_task.rs @@ -454,6 +454,7 @@ where if block_header.number() % ASYNC_BLOCK_COUNT == 0 || block_header.number() >= self.target.target_id.number() { + self.sync_dag_store.delete_all_dag_sync_block()?; self.find_absent_ancestor(vec![block_header.clone()]) .await?; @@ -474,7 +475,6 @@ where block: block.clone(), children: vec![], })?; - self.sync_dag_store.save_block(block)?; anyhow::Ok(ParallelSign::NeedMoreBlocks) } };