Skip to content

Commit

Permalink
add some annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason committed Sep 26, 2023
1 parent 49c8dd2 commit 7e8eb16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/executor/src/system_contract/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,15 @@ pub fn init<Adapter: ExecutorAdapter + ApplyBackend>(
let current_cell_root =
adapter.storage(CKB_LIGHT_CLIENT_CONTRACT_ADDRESS, *HEADER_CELL_ROOT_KEY);

// Current cell root is zero means there is no image cell and header contains in
// the MPT. Because of the empty cell root is zero rather than NLP_NULL, it is
// necessary to init the ckb light client and image account in state MPT. The
// initial process is set the storage root of the two accounts as H256::zero().
if current_cell_root.is_zero() {
let changes = generate_mpt_root_changes(adapter, CKB_LIGHT_CLIENT_CONTRACT_ADDRESS);
adapter.apply(changes, vec![], false);
}

(current_metadata_root, current_cell_root)
}

Expand Down

0 comments on commit 7e8eb16

Please sign in to comment.