@Override
  protected void internalBlockAdded(final BlockHeader blockHeader, final FeeMarket feeMarket) {
    final Wei newNextBlockBaseFee = calculateNextBlockBaseFee(feeMarket, blockHeader);

    LOG.atTrace()
        .setMessage("Updating base fee from {} to {}")
        .addArgument(nextBlockBaseFee.get()::toHumanReadableString)
        .addArgument(newNextBlockBaseFee::toHumanReadableString)
        .log();

    nextBlockBaseFee = Optional.of(newNextBlockBaseFee);
    orderByFee.clear();

    final var itTxsBySender = txsBySender.entrySet().iterator();
    while (itTxsBySender.hasNext()) {
      final var senderTxs = itTxsBySender.next().getValue();

      Optional<Long> maybeFirstDemotedNonce = Optional.empty();

      for (final var e : senderTxs.entrySet()) {
        final PendingTransaction tx = e.getValue();
        // it must pass the promotion filter to be prioritized
        if (promotionFilter(tx)) {
          orderByFee.add(tx);
        } else {
          // otherwise sender txs starting from this nonce need to be demoted to next layer,
          // and we can go to next sender
          maybeFirstDemotedNonce = Optional.of(e.getKey());
          break;
        }
      }

      maybeFirstDemotedNonce.ifPresent(
          nonce -> {
            // demote all txs after the first demoted to the next layer, because none of them is
            // executable now, and we can avoid sorting them until they are candidate for execution
            // again
            final var demoteTxs = senderTxs.tailMap(nonce, true);
            while (!demoteTxs.isEmpty()) {
              final PendingTransaction demoteTx = demoteTxs.pollLastEntry().getValue();
              LOG.atTrace()
                  .setMessage(
                      "Demoting tx {} since it does not respect anymore the requisites to stay in this layer."
                          + " Next block base fee {}")
                  .addArgument(demoteTx::toTraceLog)
                  .addArgument(newNextBlockBaseFee::toHumanReadableString)
                  .log();
              processEvict(senderTxs, demoteTx, DEMOTED);
              addToNextLayer(senderTxs, demoteTx, 0, MOVE);
            }
          });

      if (senderTxs.isEmpty()) {
        itTxsBySender.remove();
      }
    }
  }
On base fee markets when a new block is added we can calculate the base fee for the next block
and use it to keep only pending transactions willing to pay at least that fee in the
prioritized layer, since only these transactions are executable, while all the other can be
demoted to the next layer.

@param blockHeader the header of the added block
@param feeMarket the fee market
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/layered/BaseFeePrioritizedTransactions.java