Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
verify dag block by the basic verification method
  • Loading branch information
jackzhhuang committed Mar 19, 2024
1 parent 2c6f373 commit aa62d0c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chain/src/chain.rs
@@ -1,7 +1,7 @@
// Copyright (c) The Starcoin Core Contributors
// SPDX-License-Identifier: Apache-2.0

use crate::verifier::{BlockVerifier, DagVerifier, FullVerifier};
use crate::verifier::{BlockVerifier, DagBasicVerifier, DagVerifier, FullVerifier};
use anyhow::{anyhow, bail, ensure, format_err, Ok, Result};
use sp_utils::stop_watch::{watch, CHAIN_WATCH_NAME};
use starcoin_accumulator::inmemory::InMemoryAccumulator;
Expand Down Expand Up @@ -1045,7 +1045,12 @@ impl ChainReader for BlockChain {
}

fn verify(&self, block: Block) -> Result<VerifiedBlock> {
FullVerifier::verify_block(self, block)
if block.header().is_dag() {
DagBasicVerifier::verify_header(self, block.header())?;
Ok(VerifiedBlock(block))
} else {
FullVerifier::verify_block(self, block)
}
}

fn execute(&mut self, verified_block: VerifiedBlock) -> Result<ExecutedBlock> {
Expand Down

0 comments on commit aa62d0c

Please sign in to comment.