fix(chain): temporary disable challenge bad block
@@ -371,27 +371,28 @@ impl Chain {
deposit_requests,
deposit_asset_scripts,
)? {
- db.rollback()?;
- log::warn!("bad block found, rollback db");
-
- db.insert_bad_block(&l2block, &l2block_committed_info, &global_state)?;
- log::info!("insert bad block 0x{}", hex::encode(l2block.hash()));
-
- let global_block_root: H256 = global_state.block().merkle_root().unpack();
- let local_block_root = db.get_block_smt_root()?;
- assert_eq!(local_block_root, global_block_root, "block root fork");
-
- assert!(self.challenge_target.is_none());
- db.set_bad_block_challenge_target(
- &l2block.hash().into(),
- &challenge_target,
- )?;
- self.challenge_target = Some(challenge_target.clone());
- self.local_state.tip = l2block;
-
- let context =
- gw_challenge::context::build_challenge_context(db, challenge_target)?;
- Ok(SyncEvent::BadBlock { context })
+ return Err(anyhow!("bad block found"));
+ // db.rollback()?;
+ // log::warn!("bad block found, rollback db");
+ //
+ // db.insert_bad_block(&l2block, &l2block_committed_info, &global_state)?;
+ // log::info!("insert bad block 0x{}", hex::encode(l2block.hash()));
+ //
+ // let global_block_root: H256 = global_state.block().merkle_root().unpack();
+ // let local_block_root = db.get_block_smt_root()?;
+ // assert_eq!(local_block_root, global_block_root, "block root fork");
+ //
+ // assert!(self.challenge_target.is_none());
+ // db.set_bad_block_challenge_target(
+ // &l2block.hash().into(),
+ // &challenge_target,
+ // )?;
+ // self.challenge_target = Some(challenge_target.clone());
+ // self.local_state.tip = l2block;
+ //
+ // let context =
+ // gw_challenge::context::build_challenge_context(db, challenge_target)?;
+ // Ok(SyncEvent::BadBlock { context })
} else {
let block_number = l2block.raw().number().unpack();
log::info!("sync new block #{} success", block_number);
