Unblock quic_enable_chaos_protection_v2 flag Now that Chaos Protection v2 is feature complete and has good coverage in both unit tests and end-to-end tests, we're ready to start deploying it. This flag was originally called --gfe2_reloadable_flag_quic_enable_new_chaos_protector but multiple CLs landed behind it so we need to rename it before unblocking. We're renaming it to --gfe2_reloadable_flag_quic_enable_chaos_protection_v2. This CL unblocks --gfe2_reloadable_flag_quic_enable_chaos_protection_v2 for deployment on servers, and enables it in Chrome. PiperOrigin-RevId: 704858299
diff --git a/quiche/common/quiche_feature_flags_list.h b/quiche/common/quiche_feature_flags_list.h index 8c86104..1c7b8bd 100755 --- a/quiche/common/quiche_feature_flags_list.h +++ b/quiche/common/quiche_feature_flags_list.h
@@ -33,9 +33,9 @@ QUICHE_FLAG(bool, quiche_reloadable_flag_quic_discard_initial_packet_with_key_dropped, false, true, "If true, discard INITIAL packet if the key has been dropped.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_dispatcher_only_serialize_close_if_closed_by_self, false, false, "If true, QuicDispatcher::CleanUpSession only serializes a connection close if the connection is closed by self, did not complete handshake and does not have termination packets.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_ecn_in_first_ack, false, true, "When true, reports ECN in counts in the ACK of the a client initial that goes in the buffered packet store.") +QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enable_chaos_protection_v2, false, true, "If true, enable Chaos Protection v2 and use new QuicChaosProtector implementation.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enable_disable_resumption, true, true, "If true, disable resumption when receiving NRES connection option.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enable_mtu_discovery_at_server, false, false, "If true, QUIC will default enable MTU discovery at server, with a target of 1450 bytes.") -QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enable_new_chaos_protector, false, false, "If true, use new refactored QuicChaosProtector implementation.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enable_server_on_wire_ping, true, true, "If true, enable server retransmittable on wire PING.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_enable_version_rfcv2, false, false, "When true, support RFC9369.") QUICHE_FLAG(bool, quiche_reloadable_flag_quic_fin_before_completed_http_headers, false, true, "If true, close the connection with error if FIN is received before finish receiving the whole HTTP headers.")
diff --git a/quiche/quic/core/http/end_to_end_test.cc b/quiche/quic/core/http/end_to_end_test.cc index a679f71..7270ede 100644 --- a/quiche/quic/core/http/end_to_end_test.cc +++ b/quiche/quic/core/http/end_to_end_test.cc
@@ -6699,7 +6699,7 @@ ASSERT_TRUE(Initialize()); return; } - SetQuicReloadableFlag(quic_enable_new_chaos_protector, true); + SetQuicReloadableFlag(quic_enable_chaos_protection_v2, true); // Setup test harness with a custom client writer. connect_to_server_on_initialize_ = false; int discard_length;
diff --git a/quiche/quic/core/quic_packet_creator.cc b/quiche/quic/core/quic_packet_creator.cc index f982ea8..80c1dc4 100644 --- a/quiche/quic/core/quic_packet_creator.cc +++ b/quiche/quic/core/quic_packet_creator.cc
@@ -782,7 +782,7 @@ framer_->data_producer() == nullptr) { return std::nullopt; } - if (!GetQuicReloadableFlag(quic_enable_new_chaos_protector)) { + if (!GetQuicReloadableFlag(quic_enable_chaos_protection_v2)) { if (queued_frames_.size() != 2u || queued_frames_[0].type != CRYPTO_FRAME || queued_frames_[1].type != PADDING_FRAME || // Do not perform chaos protection if we do not have a known number of @@ -801,7 +801,7 @@ packet_size_, framer_, random_); return chaos_protector.BuildDataPacket(header, buffer); } - QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_new_chaos_protector, 1, 2); + QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_chaos_protection_v2, 1, 2); QuicChaosProtector chaos_protector(packet_size_, packet_.encryption_level, framer_, random_); return chaos_protector.BuildDataPacket(header, queued_frames_, buffer); @@ -1565,7 +1565,7 @@ return 0; } total_bytes_consumed += frame.crypto_frame->data_length; - if (!GetQuicReloadableFlag(quic_enable_new_chaos_protector) || + if (!GetQuicReloadableFlag(quic_enable_chaos_protection_v2) || level != ENCRYPTION_INITIAL || frame.crypto_frame->data_length < write_length) { FlushCurrentPacket(); @@ -1578,7 +1578,7 @@ size_t write_length, QuicStreamOffset offset) { if (!GetQuicFlag(quic_enable_chaos_protection) || - !GetQuicReloadableFlag(quic_enable_new_chaos_protector) || + !GetQuicReloadableFlag(quic_enable_chaos_protection_v2) || framer_->perspective() != Perspective::IS_CLIENT || level != ENCRYPTION_INITIAL || !framer_->version().UsesCryptoFrames() || framer_->data_producer() == nullptr || @@ -1708,9 +1708,9 @@ // TODO(nharper): Once we have separate packet number spaces, everything // should be driven by encryption level, and we should stop flushing in this // spot. - QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_new_chaos_protector, 2, 2); + QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_chaos_protection_v2, 2, 2); if (HasPendingRetransmittableFrames() && - (!GetQuicReloadableFlag(quic_enable_new_chaos_protector) || + (!GetQuicReloadableFlag(quic_enable_chaos_protection_v2) || level != ENCRYPTION_INITIAL)) { FlushCurrentPacket(); } @@ -1725,7 +1725,7 @@ } // Don't allow the handshake to be bundled with other retransmittable frames. - if (!GetQuicReloadableFlag(quic_enable_new_chaos_protector) || + if (!GetQuicReloadableFlag(quic_enable_chaos_protection_v2) || level != ENCRYPTION_INITIAL) { FlushCurrentPacket(); }
diff --git a/quiche/quic/core/quic_packet_creator_test.cc b/quiche/quic/core/quic_packet_creator_test.cc index 94baf89..5522bba 100644 --- a/quiche/quic/core/quic_packet_creator_test.cc +++ b/quiche/quic/core/quic_packet_creator_test.cc
@@ -3205,7 +3205,7 @@ size_t crypto_data_length, int num_ack_blocks, bool chaos_protection_enabled) { SetQuicFlag(quic_enable_chaos_protection, chaos_protection_enabled); - SetQuicReloadableFlag(quic_enable_new_chaos_protector, + SetQuicReloadableFlag(quic_enable_chaos_protection_v2, chaos_protection_enabled); random_creator_.ResetBase(4); creator_.SetEncrypter(ENCRYPTION_INITIAL,