Skip to content

Commit ab49f0e

Browse files
author
colinlyguo
committed
add more logs
1 parent b2e53df commit ab49f0e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

eth/api.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,12 @@ func testWitness(blockchain *core.BlockChain, block *types.Block, witness *state
405405
postStateRoot = diskRoot
406406
}
407407
if statedb.GetRootHash() != postStateRoot {
408-
return fmt.Errorf("state root mismatch after processing block %d (hash: %s): expected %s, got %s", block.Number(), block.Hash().Hex(), postStateRoot.Hex(), statedb.GetRootHash().Hex())
408+
executionWitness := ToExecutionWitness(witness)
409+
jsonStr, err := json.Marshal(executionWitness)
410+
if err != nil {
411+
return fmt.Errorf("state root mismatch after processing block %d (hash: %s): expected %s, got %s, but failed to marshal witness: %w", block.Number(), block.Hash().Hex(), postStateRoot.Hex(), statedb.GetRootHash().Hex(), err)
412+
}
413+
return fmt.Errorf("state root mismatch after processing block %d (hash: %s): expected %s, got %s, witness: %s", block.Number(), block.Hash().Hex(), postStateRoot.Hex(), statedb.GetRootHash().Hex(), string(jsonStr))
409414
}
410415
return nil
411416
}

0 commit comments

Comments
 (0)