From 76953e243a5303b954d0223c53a47db0af35ea3e Mon Sep 17 00:00:00 2001 From: Daniel Wang Date: Wed, 6 Nov 2024 12:17:50 +0800 Subject: [PATCH] allow local.params.parentMetaHash to be 0 --- .../protocol/contracts/layer1/based/LibProposing.sol | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/protocol/contracts/layer1/based/LibProposing.sol b/packages/protocol/contracts/layer1/based/LibProposing.sol index 81f8c199fe1..9e78516baa4 100644 --- a/packages/protocol/contracts/layer1/based/LibProposing.sol +++ b/packages/protocol/contracts/layer1/based/LibProposing.sol @@ -202,11 +202,10 @@ library LibProposing { // Check if parent block has the right meta hash. This is to allow the proposer to make sure // the block builds on the expected latest chain state. - if (local.params.parentMetaHash == 0) { - local.params.parentMetaHash = parentBlk.metaHash; - } else { - require(local.params.parentMetaHash == parentBlk.metaHash, L1_UNEXPECTED_PARENT()); - } + require( + local.params.parentMetaHash == 0 || local.params.parentMetaHash == parentBlk.metaHash, + L1_UNEXPECTED_PARENT() + ); // Initialize metadata to compute a metaHash, which forms a part of the block data to be // stored on-chain for future integrity checks. If we choose to persist all data fields in