Skip to content

Commit

Permalink
Merge pull request #4457 from nervosnetwork/revert-4452-yukang-skip-z…
Browse files Browse the repository at this point in the history
…ero-cycles-for-disable-script

Revert "Skip storing all zero cycles in db when disable script"
  • Loading branch information
quake authored May 13, 2024
2 parents d3e65cb + 53095a2 commit 4d9d57f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,20 +802,11 @@ impl ChainService {
mmr.push(b.digest())
.map_err(|e| InternalErrorKind::MMR.other(e))?;

// when `disable_script` is true, `cache_entries` is a array with all `0`
// there is no need to store them in db
let verify_entries: Option<&[Completed]> =
if switch.disable_script() {
None
} else {
Some(&cache_entries)
};

self.insert_ok_ext(
&txn,
&b.header().hash(),
ext.clone(),
verify_entries,
Some(&cache_entries),
Some(txs_sizes),
)?;

Expand Down

0 comments on commit 4d9d57f

Please sign in to comment.