From 801c236f749f142b83cc4dde2641f13cfd8f9815 Mon Sep 17 00:00:00 2001 From: chengwenxi <22697326+chengwenxi@users.noreply.github.com> Date: Mon, 18 May 2026 16:15:58 +0800 Subject: [PATCH] docs(prover): explain why header.state_root replaces morph_diskRoot The host executor switched from the custom `morph_diskRoot` RPC field to the standard `block.header.state_root` in commit e0756a4b, but the rationale was not captured in the code. After the zkTrie -> MPT migration (PR #886) the header state_root is the authoritative MPT root, so the custom field became redundant. Add a comment so future readers don't have to dig through git history to understand the equivalence. --- prover/crates/executor/host/src/execute.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prover/crates/executor/host/src/execute.rs b/prover/crates/executor/host/src/execute.rs index 690ebaaae..10dd2ac31 100644 --- a/prover/crates/executor/host/src/execute.rs +++ b/prover/crates/executor/host/src/execute.rs @@ -29,6 +29,9 @@ impl HostExecutor { let block = query_block(block_number, provider) .await .with_context(|| format!("query_block failed for block {block_number}"))?; + // Post-MPT migration (PR #886), the L2 state trie is a standard Ethereum MPT, so + // `header.state_root` is authoritative and replaces the previous custom `morph_diskRoot` + // RPC field. The root is re-derived locally below and checked against this value. let post_state_root = block.header.state_root; // layer2 chain id @@ -49,6 +52,7 @@ impl HostExecutor { let prev_block = query_block(prev_block_number, provider) .await .with_context(|| format!("query_block failed for prev block {prev_block_number}"))?; + // Same rationale as `post_state_root`: header state_root is the MPT root. let prev_state_root = prev_block.header.state_root; let tx_count = block.transactions.len();