default boolean blockIsOnCanonicalChain(final Hash blockHeaderHash) {
    return getBlockHeader(blockHeaderHash)
        .flatMap(h -> getBlockHashByNumber(h.getNumber()))
        .filter(h -> h.equals(blockHeaderHash))
        .isPresent();
  }
Checks whether the block corresponding to the given hash is on the canonical chain.

@param blockHeaderHash The hash of the block to check.
@return true if the block corresponding to the hash is on the canonical chain.
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/chain/Blockchain.java