private static Transaction decodeTypedTransaction(
      final RLPInput rlpInput, final EncodingContext context) {
    // Read the typed transaction bytes from the RLP input
    final Bytes typedTransactionBytes = rlpInput.readBytes();

    // Determine the transaction type from the typed transaction bytes
    TransactionType transactionType =
        getTransactionType(typedTransactionBytes)
            .orElseThrow((() -> new IllegalArgumentException("Unsupported transaction type")));
    return decodeTypedTransaction(typedTransactionBytes, transactionType, context);
  }
Decodes a typed transaction from an RLP input. It first reads the transaction type from the
input, then uses the appropriate decoder for that type.

@param rlpInput the RLP input
@return the decoded transaction
ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/TransactionDecoder.java