Deprecate quic_stop_sending_legacy_version_info and quic_stop_parsing_legacy_version_info

This CL deprecates gfe2_restart_flag_quic_stop_sending_legacy_version_info and gfe2_restart_flag_quic_stop_parsing_legacy_version_info, and removes the associated now-unused code.

PiperOrigin-RevId: 906560284
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h
index 1966108..43a9685 100755
--- a/quiche/common/quiche_feature_flags_list.h
+++ b/quiche/common/quiche_feature_flags_list.h
@@ -69,8 +69,6 @@
 QUICHE_FLAG(bool, quiche_reloadable_flag_quic_use_received_client_addresses_cache, true, true, "If true, use a LRU cache to record client addresses of packets received on server's original address.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_dispatcher_close_connection_on_invalid_ack, false, false, "An invalid ack is an ack that the peer sent for a packet that was not sent by the dispatcher. If true, the dispatcher will close the connection if it receives an invalid ack.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_shed_tls_handshake_config, false, false, "If true, QUIC connections will call SSL_set_shed_handshake_config to drop BoringSSL handshake state after the handshake finishes in order to save memory.")
-QUICHE_FLAG(bool, quiche_restart_flag_quic_stop_parsing_legacy_version_info, true, true, "If true, disable parsing the legacy version information transport parameter.")
-QUICHE_FLAG(bool, quiche_restart_flag_quic_stop_sending_legacy_version_info, true, true, "If true, disable sending the legacy version information transport parameter.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_support_release_time_for_gso, false, false, "If true, QuicGsoBatchWriter will support release time if it is available and the process has the permission to do so.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_testonly_default_false, false, false, "A testonly restart flag that will always default to false.")
 QUICHE_FLAG(bool, quiche_restart_flag_quic_testonly_default_true, true, true, "A testonly restart flag that will always default to true.")
diff --git a/quiche/quic/core/crypto/quic_client_session_cache_test.cc b/quiche/quic/core/crypto/quic_client_session_cache_test.cc
index 14d3e8b..1a9e660 100644
--- a/quiche/quic/core/crypto/quic_client_session_cache_test.cc
+++ b/quiche/quic/core/crypto/quic_client_session_cache_test.cc
@@ -19,7 +19,6 @@
 
 const QuicTime::Delta kTimeout = QuicTime::Delta::FromSeconds(1000);
 const QuicVersionLabel kFakeVersionLabel = 0x01234567;
-const QuicVersionLabel kFakeVersionLabel2 = 0x89ABCDEF;
 const uint64_t kFakeIdleTimeoutMilliseconds = 12012;
 const uint8_t kFakeStatelessResetTokenData[16] = {
     0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
@@ -40,15 +39,6 @@
       kFakeStatelessResetTokenData + sizeof(kFakeStatelessResetTokenData));
 }
 
-TransportParameters::LegacyVersionInformation
-CreateFakeLegacyVersionInformation() {
-  TransportParameters::LegacyVersionInformation legacy_version_information;
-  legacy_version_information.version = kFakeVersionLabel;
-  legacy_version_information.supported_versions.push_back(kFakeVersionLabel);
-  legacy_version_information.supported_versions.push_back(kFakeVersionLabel2);
-  return legacy_version_information;
-}
-
 TransportParameters::VersionInformation CreateFakeVersionInformation() {
   TransportParameters::VersionInformation version_information;
   version_information.chosen_version = kFakeVersionLabel;
@@ -60,7 +50,6 @@
 std::unique_ptr<TransportParameters> MakeFakeTransportParams() {
   auto params = std::make_unique<TransportParameters>();
   params->perspective = Perspective::IS_CLIENT;
-  params->legacy_version_information = CreateFakeLegacyVersionInformation();
   params->version_information = CreateFakeVersionInformation();
   params->max_idle_timeout_ms.set_value(kFakeIdleTimeoutMilliseconds);
   params->stateless_reset_token = CreateFakeStatelessResetToken();
diff --git a/quiche/quic/core/crypto/transport_parameters.cc b/quiche/quic/core/crypto/transport_parameters.cc
index 54fdd43..06faf05 100644
--- a/quiche/quic/core/crypto/transport_parameters.cc
+++ b/quiche/quic/core/crypto/transport_parameters.cc
@@ -94,8 +94,8 @@
   // 0x312B was used to indicate that QUIC+TLS key updates were not supported.
   // 0x4751 was used for non-standard Google-specific parameters encoded as a
   // Google QUIC_CRYPTO CHLO, it has been replaced by individual parameters.
-  kGoogleQuicVersion =
-      0x4752,  // Used to transmit version and supported_versions.
+  // 0x4752 was used to transmit Google-specific version and supported_versions,
+  // it was replaced by kVersionInformation.
 
   kMinAckDelayDraft10 = 0xFF04DE1B,  // draft-ietf-quic-delayed-ack-10 and -11.
   kVersionInformation = 0x11,        // RFC 9368.
@@ -171,11 +171,6 @@
       return "initial_round_trip_time";
     case TransportParameters::kGoogleConnectionOptions:
       return "google_connection_options";
-    case TransportParameters::kGoogleQuicVersion:
-      if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info)) {
-        return absl::StrCat("Unknown(", param_id, ")");
-      }
-      return "google-version";
     case TransportParameters::kMinAckDelayDraft10:
       return "min_ack_delay_us";
     case TransportParameters::kVersionInformation:
@@ -259,8 +254,6 @@
     case TransportParameters::kReliableStreamReset:
     case TransportParameters::kVersionInformation:
       return true;
-    case TransportParameters::kGoogleQuicVersion:
-      return !GetQuicRestartFlag(quic_stop_parsing_legacy_version_info);
   }
   return false;
 }
@@ -374,38 +367,6 @@
          "]";
 }
 
-TransportParameters::LegacyVersionInformation::LegacyVersionInformation()
-    : version(0) {}
-
-bool TransportParameters::LegacyVersionInformation::operator==(
-    const LegacyVersionInformation& rhs) const {
-  return version == rhs.version && supported_versions == rhs.supported_versions;
-}
-
-bool TransportParameters::LegacyVersionInformation::operator!=(
-    const LegacyVersionInformation& rhs) const {
-  return !(*this == rhs);
-}
-
-std::string TransportParameters::LegacyVersionInformation::ToString() const {
-  std::string rv =
-      absl::StrCat("legacy[version ", QuicVersionLabelToString(version));
-  if (!supported_versions.empty()) {
-    absl::StrAppend(&rv,
-                    " supported_versions " +
-                        QuicVersionLabelVectorToString(supported_versions));
-  }
-  absl::StrAppend(&rv, "]");
-  return rv;
-}
-
-std::ostream& operator<<(std::ostream& os,
-                         const TransportParameters::LegacyVersionInformation&
-                             legacy_version_information) {
-  os << legacy_version_information.ToString();
-  return os;
-}
-
 TransportParameters::VersionInformation::VersionInformation()
     : chosen_version(0) {}
 
@@ -450,9 +411,6 @@
   } else {
     rv += "Client";
   }
-  if (legacy_version_information.has_value()) {
-    rv += " " + legacy_version_information->ToString();
-  }
   if (version_information.has_value()) {
     rv += " " + version_information->ToString();
   }
@@ -577,8 +535,7 @@
 {}
 
 TransportParameters::TransportParameters(const TransportParameters& other)
-    : legacy_version_information(other.legacy_version_information),
-      version_information(other.version_information),
+    : version_information(other.version_information),
       original_destination_connection_id(
           other.original_destination_connection_id),
       max_idle_timeout_ms(other.max_idle_timeout_ms),
@@ -617,7 +574,6 @@
 
 bool TransportParameters::operator==(const TransportParameters& rhs) const {
   if (!(perspective == rhs.perspective &&
-        legacy_version_information == rhs.legacy_version_information &&
         version_information == rhs.version_information &&
         original_destination_connection_id ==
             rhs.original_destination_connection_id &&
@@ -791,17 +747,6 @@
         << "Not serializing invalid transport parameters: " << error_details;
     return false;
   }
-  if (GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    QUIC_RESTART_FLAG_COUNT_N(quic_stop_sending_legacy_version_info, 1, 4);
-  } else {
-    if (!in.legacy_version_information.has_value() ||
-        in.legacy_version_information->version == 0 ||
-        (in.perspective == Perspective::IS_SERVER &&
-         in.legacy_version_information->supported_versions.empty())) {
-      QUIC_BUG(missing versions) << "Refusing to serialize without versions";
-      return false;
-    }
-  }
   TransportParameters::ParameterMap custom_parameters = in.custom_parameters;
   for (const auto& kv : custom_parameters) {
     if (kv.first % 31 == 27) {
@@ -858,7 +803,7 @@
       kTypeAndValueLength +               // google_handshake_message
       kTypeAndValueLength +               // debugging_sni
       kTypeAndValueLength +               // google_connection_options
-      kTypeAndValueLength;                // google-version
+      kTypeAndValueLength;                // version_information
 
   std::vector<TransportParameters::TransportParameterId> parameter_ids = {
       TransportParameters::kOriginalDestinationConnectionId,
@@ -887,7 +832,6 @@
       TransportParameters::kInitialSourceConnectionId,
       TransportParameters::kRetrySourceConnectionId,
       TransportParameters::kGoogleConnectionOptions,
-      TransportParameters::kGoogleQuicVersion,
       TransportParameters::kVersionInformation,
   };
 
@@ -897,14 +841,6 @@
     max_transport_param_length +=
         in.google_connection_options->size() * sizeof(QuicTag);
   }
-  // Google-specific version extension.
-  if (in.legacy_version_information.has_value()) {
-    max_transport_param_length +=
-        sizeof(in.legacy_version_information->version) +
-        1 /* versions length */ +
-        in.legacy_version_information->supported_versions.size() *
-            sizeof(QuicVersionLabel);
-  }
   // version_information.
   if (in.version_information.has_value()) {
     max_transport_param_length +=
@@ -1301,52 +1237,6 @@
           }
         }
       } break;
-      // Google-specific version extension.
-      case TransportParameters::kGoogleQuicVersion: {
-        if (GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-          QUIC_RESTART_FLAG_COUNT_N(quic_stop_sending_legacy_version_info, 2,
-                                    4);
-          break;
-        }
-        if (!in.legacy_version_information.has_value()) {
-          break;
-        }
-        static_assert(sizeof(QuicVersionLabel) == sizeof(uint32_t),
-                      "bad length");
-        uint64_t google_version_length =
-            sizeof(in.legacy_version_information->version);
-        if (in.perspective == Perspective::IS_SERVER) {
-          google_version_length +=
-              /* versions length */ sizeof(uint8_t) +
-              sizeof(QuicVersionLabel) *
-                  in.legacy_version_information->supported_versions.size();
-        }
-        if (!writer.WriteVarInt62(TransportParameters::kGoogleQuicVersion) ||
-            !writer.WriteVarInt62(
-                /* transport parameter length */ google_version_length) ||
-            !writer.WriteUInt32(in.legacy_version_information->version)) {
-          QUIC_BUG(Failed to write Google version extension)
-              << "Failed to write Google version extension for " << in;
-          return false;
-        }
-        if (in.perspective == Perspective::IS_SERVER) {
-          if (!writer.WriteUInt8(
-                  sizeof(QuicVersionLabel) *
-                  in.legacy_version_information->supported_versions.size())) {
-            QUIC_BUG(Failed to write versions length)
-                << "Failed to write versions length for " << in;
-            return false;
-          }
-          for (QuicVersionLabel version_label :
-               in.legacy_version_information->supported_versions) {
-            if (!writer.WriteUInt32(version_label)) {
-              QUIC_BUG(Failed to write supported version)
-                  << "Failed to write supported version for " << in;
-              return false;
-            }
-          }
-        }
-      } break;
       // version_information.
       case TransportParameters::kVersionInformation: {
         if (!in.version_information.has_value()) {
@@ -1657,47 +1547,6 @@
           out->google_connection_options->push_back(connection_option);
         }
       } break;
-      case TransportParameters::kGoogleQuicVersion: {
-        if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info)) {
-          QUIC_RESTART_FLAG_COUNT_N(quic_stop_parsing_legacy_version_info, 3,
-                                    3);
-          if (out->custom_parameters.find(param_id) !=
-              out->custom_parameters.end()) {
-            *error_details = "Received a second unknown parameter" +
-                             TransportParameterIdToString(param_id);
-            return false;
-          }
-          out->custom_parameters[param_id] =
-              std::string(value_reader.ReadRemainingPayload());
-          break;
-        }
-        if (!out->legacy_version_information.has_value()) {
-          out->legacy_version_information =
-              TransportParameters::LegacyVersionInformation();
-        }
-        if (!value_reader.ReadUInt32(
-                &out->legacy_version_information->version)) {
-          *error_details = "Failed to read Google version extension version";
-          return false;
-        }
-        if (perspective == Perspective::IS_SERVER) {
-          uint8_t versions_length;
-          if (!value_reader.ReadUInt8(&versions_length)) {
-            *error_details = "Failed to parse Google supported versions length";
-            return false;
-          }
-          const uint8_t num_versions = versions_length / sizeof(uint32_t);
-          for (uint8_t i = 0; i < num_versions; ++i) {
-            QuicVersionLabel parsed_version;
-            if (!value_reader.ReadUInt32(&parsed_version)) {
-              *error_details = "Failed to parse Google supported version";
-              return false;
-            }
-            out->legacy_version_information->supported_versions.push_back(
-                parsed_version);
-          }
-        }
-      } break;
       case TransportParameters::kVersionInformation: {
         if (out->version_information.has_value()) {
           *error_details = "Received a second version_information";
diff --git a/quiche/quic/core/crypto/transport_parameters.h b/quiche/quic/core/crypto/transport_parameters.h
index 14f1518..14289ba 100644
--- a/quiche/quic/core/crypto/transport_parameters.h
+++ b/quiche/quic/core/crypto/transport_parameters.h
@@ -109,38 +109,6 @@
         std::ostream& os, const TransportParameters& params);
   };
 
-  // LegacyVersionInformation represents the Google QUIC downgrade prevention
-  // mechanism ported to QUIC+TLS. It is exchanged using transport parameter ID
-  // 0x4752 and is in the process of being deprecated in favor of RFC 9368
-  // which uses the VersionInformation class below.
-  struct QUICHE_EXPORT LegacyVersionInformation {
-    LegacyVersionInformation();
-    LegacyVersionInformation(const LegacyVersionInformation& other) = default;
-    LegacyVersionInformation& operator=(const LegacyVersionInformation& other) =
-        default;
-    LegacyVersionInformation& operator=(LegacyVersionInformation&& other) =
-        default;
-    LegacyVersionInformation(LegacyVersionInformation&& other) = default;
-    ~LegacyVersionInformation() = default;
-    bool operator==(const LegacyVersionInformation& rhs) const;
-    bool operator!=(const LegacyVersionInformation& rhs) const;
-    // When sent by the client, |version| is the initial version offered by the
-    // client (before any version negotiation packets) for this connection. When
-    // sent by the server, |version| is the version that is in use.
-    QuicVersionLabel version;
-
-    // When sent by the server, |supported_versions| contains a list of all
-    // versions that the server would send in a version negotiation packet. When
-    // sent by the client, this is empty.
-    QuicVersionLabelVector supported_versions;
-
-    // Allows easily logging.
-    std::string ToString() const;
-    friend QUICHE_EXPORT std::ostream& operator<<(
-        std::ostream& os,
-        const LegacyVersionInformation& legacy_version_information);
-  };
-
   // Version information used for version downgrade prevention and compatible
   // version negotiation. See RFC 9368.
   struct QUICHE_EXPORT VersionInformation {
@@ -184,10 +152,6 @@
   friend QUICHE_EXPORT std::ostream& operator<<(
       std::ostream& os, const TransportParameters& params);
 
-  // Google QUIC downgrade prevention mechanism sent over QUIC+TLS. This is
-  // being deprecated in favor of the version_information field below.
-  std::optional<LegacyVersionInformation> legacy_version_information;
-
   // IETF downgrade prevention and compatible version negotiation, see RFC 9368.
   std::optional<VersionInformation> version_information;
 
diff --git a/quiche/quic/core/crypto/transport_parameters_test.cc b/quiche/quic/core/crypto/transport_parameters_test.cc
index 5ae199b..efc5926 100644
--- a/quiche/quic/core/crypto/transport_parameters_test.cc
+++ b/quiche/quic/core/crypto/transport_parameters_test.cc
@@ -52,8 +52,6 @@
 const char* kCustomParameter1Value = "foo";
 const auto kCustomParameter2 =
     static_cast<TransportParameters::TransportParameterId>(0xff34);
-const auto kLegacyVersionInfoParameter =
-    static_cast<TransportParameters::TransportParameterId>(0x4752);
 const char* kCustomParameter2Value = "bar";
 
 const char kFakeGoogleHandshakeMessage[] =
@@ -114,22 +112,6 @@
       preferred_address);
 }
 
-TransportParameters::LegacyVersionInformation
-CreateFakeLegacyVersionInformationClient() {
-  TransportParameters::LegacyVersionInformation legacy_version_information;
-  legacy_version_information.version = kFakeVersionLabel;
-  return legacy_version_information;
-}
-
-TransportParameters::LegacyVersionInformation
-CreateFakeLegacyVersionInformationServer() {
-  TransportParameters::LegacyVersionInformation legacy_version_information =
-      CreateFakeLegacyVersionInformationClient();
-  legacy_version_information.supported_versions.push_back(kFakeVersionLabel);
-  legacy_version_information.supported_versions.push_back(kFakeVersionLabel2);
-  return legacy_version_information;
-}
-
 TransportParameters::VersionInformation CreateFakeVersionInformation() {
   TransportParameters::VersionInformation version_information;
   version_information.chosen_version = kFakeVersionLabel;
@@ -189,13 +171,6 @@
   EXPECT_FALSE(orig_params == new_params);
   EXPECT_TRUE(orig_params != new_params);
   new_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-    new_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.version_information = CreateFakeVersionInformation();
   new_params.version_information = CreateFakeVersionInformation();
   orig_params.disable_active_migration = true;
@@ -210,20 +185,6 @@
   EXPECT_TRUE(orig_params == new_params);
   EXPECT_FALSE(orig_params != new_params);
 
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    // Test comparison on vectors.
-    orig_params.legacy_version_information.value().supported_versions.push_back(
-        kFakeVersionLabel);
-    new_params.legacy_version_information.value().supported_versions.push_back(
-        kFakeVersionLabel2);
-    EXPECT_NE(orig_params, new_params);
-    EXPECT_FALSE(orig_params == new_params);
-    EXPECT_TRUE(orig_params != new_params);
-    new_params.legacy_version_information.value().supported_versions.pop_back();
-    new_params.legacy_version_information.value().supported_versions.push_back(
-        kFakeVersionLabel);
-  }
   orig_params.stateless_reset_token = CreateStatelessResetTokenForTest();
   new_params.stateless_reset_token = CreateStatelessResetTokenForTest();
   EXPECT_EQ(orig_params, new_params);
@@ -282,11 +243,6 @@
 TEST_P(TransportParametersTest, CopyConstructor) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.version_information = CreateFakeVersionInformation();
   orig_params.original_destination_connection_id =
       CreateFakeOriginalDestinationConnectionId();
@@ -332,10 +288,6 @@
 TEST_P(TransportParametersTest, RoundTripClient) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.version_information = CreateFakeVersionInformation();
   orig_params.max_idle_timeout_ms.set_value(kFakeIdleTimeoutMilliseconds);
   orig_params.max_udp_payload_size.set_value(kMaxPacketSizeForTest);
@@ -380,21 +332,12 @@
       << error_details;
   EXPECT_TRUE(error_details.empty());
   RemoveGreaseParameters(&new_params);
-  if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) &&
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information.reset();
-    new_params.custom_parameters.erase(kLegacyVersionInfoParameter);
-  }
   EXPECT_EQ(new_params, orig_params);
 }
 
 TEST_P(TransportParametersTest, RoundTripServer) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_SERVER;
-  if (!GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationServer();
-  }
   orig_params.version_information = CreateFakeVersionInformation();
   orig_params.original_destination_connection_id =
       CreateFakeOriginalDestinationConnectionId();
@@ -435,11 +378,6 @@
       << error_details;
   EXPECT_TRUE(error_details.empty());
   RemoveGreaseParameters(&new_params);
-  if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) &&
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information.reset();
-    new_params.custom_parameters.erase(kLegacyVersionInfoParameter);
-  }
   EXPECT_EQ(new_params, orig_params);
 }
 
@@ -546,11 +484,6 @@
 TEST_P(TransportParametersTest, NoClientParamsWithStatelessResetToken) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.max_idle_timeout_ms.set_value(kFakeIdleTimeoutMilliseconds);
   orig_params.stateless_reset_token = CreateStatelessResetTokenForTest();
   orig_params.max_udp_payload_size.set_value(kMaxPacketSizeForTest);
@@ -674,13 +607,6 @@
       << error_details;
   EXPECT_TRUE(error_details.empty());
   EXPECT_EQ(Perspective::IS_CLIENT, new_params.perspective);
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info)) {
-    ASSERT_TRUE(new_params.legacy_version_information.has_value());
-    EXPECT_EQ(kFakeVersionLabel,
-              new_params.legacy_version_information.value().version);
-    EXPECT_TRUE(new_params.legacy_version_information.value()
-                    .supported_versions.empty());
-  }
   ASSERT_TRUE(new_params.version_information.has_value());
   EXPECT_EQ(new_params.version_information.value(),
             CreateFakeVersionInformation());
@@ -941,19 +867,6 @@
       << error_details;
   EXPECT_TRUE(error_details.empty());
   EXPECT_EQ(Perspective::IS_SERVER, new_params.perspective);
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info)) {
-    ASSERT_TRUE(new_params.legacy_version_information.has_value());
-    EXPECT_EQ(kFakeVersionLabel,
-              new_params.legacy_version_information.value().version);
-    ASSERT_EQ(2u, new_params.legacy_version_information.value()
-                      .supported_versions.size());
-    EXPECT_EQ(
-        kFakeVersionLabel,
-        new_params.legacy_version_information.value().supported_versions[0]);
-    EXPECT_EQ(
-        kFakeVersionLabel2,
-        new_params.legacy_version_information.value().supported_versions[1]);
-  }
   ASSERT_TRUE(new_params.version_information.has_value());
   EXPECT_EQ(new_params.version_information.value(),
             CreateFakeVersionInformation());
@@ -1074,10 +987,6 @@
   std::string custom_value(70000, '?');
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.custom_parameters[kCustomParameter1] = custom_value;
 
   std::vector<uint8_t> serialized;
@@ -1091,22 +1000,12 @@
       << error_details;
   EXPECT_TRUE(error_details.empty());
   RemoveGreaseParameters(&new_params);
-  if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) &&
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information.reset();
-    new_params.custom_parameters.erase(kLegacyVersionInfoParameter);
-  }
   EXPECT_EQ(new_params, orig_params);
 }
 
 TEST_P(TransportParametersTest, SerializationOrderIsRandom) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.max_idle_timeout_ms.set_value(kFakeIdleTimeoutMilliseconds);
   orig_params.max_udp_payload_size.set_value(kMaxPacketSizeForTest);
   orig_params.initial_max_data.set_value(kFakeInitialMaxData);
@@ -1149,10 +1048,6 @@
 TEST_P(TransportParametersTest, Degrease) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.version_information = CreateFakeVersionInformation();
   orig_params.max_idle_timeout_ms.set_value(kFakeIdleTimeoutMilliseconds);
   orig_params.max_udp_payload_size.set_value(kMaxPacketSizeForTest);
@@ -1200,22 +1095,12 @@
   EXPECT_NE(new_params, orig_params);
 
   DegreaseTransportParameters(new_params);
-  if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) &&
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information.reset();
-    new_params.custom_parameters.erase(kLegacyVersionInfoParameter);
-  }
   EXPECT_EQ(new_params, orig_params);
 }
 
 TEST_P(TransportParametersTest, DebuggingSniParsingClientToServer) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_CLIENT;
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationClient();
-  }
   orig_params.debugging_sni = kFakeSni;
 
   std::vector<uint8_t> serialized;
@@ -1233,11 +1118,6 @@
 TEST_P(TransportParametersTest, ServerCannotSendDebuggingSni) {
   TransportParameters orig_params;
   orig_params.perspective = Perspective::IS_SERVER;
-  if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-      !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    orig_params.legacy_version_information =
-        CreateFakeLegacyVersionInformationServer();
-  }
   orig_params.debugging_sni = kFakeSni;
 
   std::vector<uint8_t> out;
@@ -1251,11 +1131,6 @@
  protected:
   void SetUp() override {
     original_params_.perspective = Perspective::IS_SERVER;
-    if (!GetQuicRestartFlag(quic_stop_parsing_legacy_version_info) ||
-        !GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-      original_params_.legacy_version_information =
-          CreateFakeLegacyVersionInformationServer();
-    }
     original_params_.original_destination_connection_id =
         CreateFakeOriginalDestinationConnectionId();
     original_params_.max_idle_timeout_ms.set_value(
diff --git a/quiche/quic/core/tls_client_handshaker.cc b/quiche/quic/core/tls_client_handshaker.cc
index d633c7b..fb50241 100644
--- a/quiche/quic/core/tls_client_handshaker.cc
+++ b/quiche/quic/core/tls_client_handshaker.cc
@@ -291,14 +291,6 @@
 bool TlsClientHandshaker::SetTransportParameters() {
   TransportParameters params;
   params.perspective = Perspective::IS_CLIENT;
-  if (GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    QUIC_RESTART_FLAG_COUNT_N(quic_stop_sending_legacy_version_info, 4, 4);
-  } else {
-    params.legacy_version_information =
-        TransportParameters::LegacyVersionInformation();
-    params.legacy_version_information->version =
-        CreateQuicVersionLabel(session()->supported_versions().front());
-  }
   params.version_information = TransportParameters::VersionInformation();
   const QuicVersionLabel version = CreateQuicVersionLabel(session()->version());
   params.version_information->chosen_version = version;
@@ -353,25 +345,7 @@
   // Notify QuicConnectionDebugVisitor.
   session()->connection()->OnTransportParametersReceived(
       *received_transport_params_);
-  if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info)) {
-    QUIC_RESTART_FLAG_COUNT_N(quic_stop_parsing_legacy_version_info, 1, 3);
-  } else {
-    if (received_transport_params_->legacy_version_information.has_value()) {
-      if (received_transport_params_->legacy_version_information->version !=
-          CreateQuicVersionLabel(session()->connection()->version())) {
-        *error_details = "Version mismatch detected";
-        return false;
-      }
-      if (CryptoUtils::ValidateServerHelloVersions(
-              received_transport_params_->legacy_version_information
-                  ->supported_versions,
-              session()->connection()->server_supported_versions(),
-              error_details) != QUIC_NO_ERROR) {
-        QUICHE_DCHECK(!error_details->empty());
-        return false;
-      }
-    }
-  }
+
   if (received_transport_params_->version_information.has_value()) {
     if (!CryptoUtils::ValidateChosenVersion(
             received_transport_params_->version_information->chosen_version,
diff --git a/quiche/quic/core/tls_server_handshaker.cc b/quiche/quic/core/tls_server_handshaker.cc
index 13cfb9c..2745f46 100644
--- a/quiche/quic/core/tls_server_handshaker.cc
+++ b/quiche/quic/core/tls_server_handshaker.cc
@@ -525,17 +525,6 @@
 
   // Notify QuicConnectionDebugVisitor.
   session()->connection()->OnTransportParametersReceived(client_params);
-  if (GetQuicRestartFlag(quic_stop_parsing_legacy_version_info)) {
-    QUIC_RESTART_FLAG_COUNT_N(quic_stop_parsing_legacy_version_info, 2, 3);
-  } else {
-    if (client_params.legacy_version_information.has_value() &&
-        CryptoUtils::ValidateClientHelloVersion(
-            client_params.legacy_version_information->version,
-            session()->connection()->version(), session()->supported_versions(),
-            error_details) != QUIC_NO_ERROR) {
-      return false;
-    }
-  }
 
   if (client_params.version_information.has_value() &&
       !CryptoUtils::ValidateChosenVersion(
@@ -565,16 +554,6 @@
   QUICHE_DCHECK(!result.success);
 
   server_params_.perspective = Perspective::IS_SERVER;
-  if (GetQuicRestartFlag(quic_stop_sending_legacy_version_info)) {
-    QUIC_RESTART_FLAG_COUNT_N(quic_stop_sending_legacy_version_info, 3, 4);
-  } else {
-    server_params_.legacy_version_information =
-        TransportParameters::LegacyVersionInformation();
-    server_params_.legacy_version_information->supported_versions =
-        CreateQuicVersionLabelVector(session()->supported_versions());
-    server_params_.legacy_version_information->version =
-        CreateQuicVersionLabel(session()->connection()->version());
-  }
   server_params_.version_information =
       TransportParameters::VersionInformation();
   server_params_.version_information->chosen_version =
diff --git a/quiche/quic/core/tls_server_handshaker_test.cc b/quiche/quic/core/tls_server_handshaker_test.cc
index 993c54a..a5d9b63 100644
--- a/quiche/quic/core/tls_server_handshaker_test.cc
+++ b/quiche/quic/core/tls_server_handshaker_test.cc
@@ -1394,13 +1394,6 @@
   TransportParameters server_params;
   std::string error_details;
   server_params.perspective = quic::Perspective::IS_SERVER;
-  server_params.legacy_version_information =
-      TransportParameters::LegacyVersionInformation();
-  server_params.legacy_version_information.value().supported_versions =
-      quic::CreateQuicVersionLabelVector(
-          quic::ParsedQuicVersionVector{version});
-  server_params.legacy_version_information.value().version =
-      quic::CreateQuicVersionLabel(version);
   server_params.version_information = TransportParameters::VersionInformation();
   server_params.version_information.value().chosen_version =
       quic::CreateQuicVersionLabel(version);