diff --git a/state/state.go b/state/state.go index 56b6354f5f6..f851bf84e01 100644 --- a/state/state.go +++ b/state/state.go @@ -295,7 +295,6 @@ func (state State) MakeBlock( proposerAddress, &encryptedRandom, implicitHash, ) - fmt.Printf("------------ HEADER HASH : %+v\n", block.Header.Hash()) return block } diff --git a/state/validation.go b/state/validation.go index b79b0d05491..81dbc2f315a 100644 --- a/state/validation.go +++ b/state/validation.go @@ -2,6 +2,7 @@ package state import ( "bytes" + "crypto/sha256" "encoding/hex" "errors" "fmt" @@ -125,7 +126,10 @@ func validateBlock(state State, block *types.Block) error { return fmt.Errorf("failed to get implicit hash: %w", err) } if !bytes.Equal(block.Header.ImplicitHash, expectedImplicitHash) { - return fmt.Errorf("implicit_hash mismatch: expected %X, got %X", hex.EncodeToString(expectedImplicitHash), hex.EncodeToString(block.Header.ImplicitHash)) + emptySha256 := sha256.Sum256([]byte{}) + if !(bytes.Equal(block.Header.ImplicitHash, []byte{}) && bytes.Equal(expectedImplicitHash, emptySha256[:])) { + return fmt.Errorf("implicit_hash mismatch: expected %X, got %X", hex.EncodeToString(expectedImplicitHash), hex.EncodeToString(block.Header.ImplicitHash)) + } } // Validate block Time