From 7e8eb1643c9979529cd1d38b7c6a58eefb216ff3 Mon Sep 17 00:00:00 2001 From: Eason Date: Tue, 26 Sep 2023 16:26:22 +0800 Subject: [PATCH] add some annotation --- core/executor/src/system_contract/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/executor/src/system_contract/mod.rs b/core/executor/src/system_contract/mod.rs index 827a3e1aa..649e43c56 100644 --- a/core/executor/src/system_contract/mod.rs +++ b/core/executor/src/system_contract/mod.rs @@ -131,10 +131,15 @@ pub fn init( 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) }