@Override
    protected void encode(
        final ChannelHandlerContext context,
        final OutboundMessage outboundMessage,
        final ByteBuf out) {
      if (outboundMessage.getCapability() != null
          || outboundMessage.getData().getCode() != WireMessageCodes.HELLO) {
        throw new IllegalStateException("First wire message sent wasn't a HELLO.");
      }
      framer.frame(outboundMessage.getData(), out);
      context.pipeline().remove(this);
    }
Ensures that wire hello message is the first message written.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/AbstractHandshakeHandler.java