private void storeBlockHeader(final BlockHeader blockHeader) {
    Difficulty difficulty = blockchain.calculateTotalDifficulty(blockHeader);
    blockchain.unsafeStoreHeader(blockHeader, difficulty);
    if (isPoS && blockHeader.getNumber() == lastPoWBlockNumber && consensusContext.isPresent()) {
      blockchain
          .getTotalDifficultyByHash(blockHeader.getHash())
          .ifPresent(consensusContext.get()::setIsPostMerge);
    }
  }
A step in the synchronization process that saves historical block headers.
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/SavePreMergeHeadersStep.java