Skip to content

Commit b42e72c

Browse files
committed
fix(validation): handle zero parent hash for first block after genesis
- Added a check in the validation function to accept a zero parent hash, indicating the first block after genesis. - This change improves the handling of block validation during the initial block production phase.
1 parent aeda9f6 commit b42e72c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/actors_v2/common/validation.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ pub async fn validate_parent_relationship(
9797
return Ok(());
9898
}
9999

100+
// Parent hash is zero for the first block after genesis
101+
if parent_hash.is_zero() {
102+
tracing::debug!("Parent hash is zero - accepting as first block after genesis");
103+
return Ok(());
104+
}
105+
100106
tracing::debug!(
101107
block_height = block_height,
102108
parent_hash = %parent_hash,

0 commit comments

Comments
 (0)