511 Commits

Author SHA1 Message Date
Michael Lumish
088436d01c [xds] Implement gRFC A101 (#41051)
This includes two major changes:

 1. An additional credentials option `sni_override` with the type `optional<string>`. If `nullopt`, it has no effect, and if set to the empty string it disables sending SNI entirely. Otherwise, the specified string will be sent.
 2. The implementation of [gRFC A101](https://github.com/grpc/proposal/blob/master/A101-SNI-setting-and-SNI-SAN-validation.md) using that new option. This includes options to set SNI and to validate SAN values against the set SNI value.

Closes #41051

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41051 from murgatroid99:xds_sni_support 6a1f8667dedc19947532720495b2932889236a12
PiperOrigin-RevId: 855765736
2026-01-13 09:48:39 -08:00
Rishesh Agarwal
7c14fdbfdf remove default_applicable_licenses to tools/codegen BUILD files.
PiperOrigin-RevId: 837063317
2025-11-26 04:34:23 -08:00
Rishesh Agarwal
eaae0ff558 Adding layering_check and parse_headers in each bazel codegen build file
PiperOrigin-RevId: 837002393
2025-11-26 01:10:53 -08:00
Vignesh Babu
749844fd38 [Build Cleanup] Change sanitize script to use C++ trace flags and stats data code generators instead of python scripts (#40906)
- The python code generators are deleted
- In a future PR, the sanitize script will be updated to use the C++ experiments code generator and the python script will also be deleted

Closes #40906

PiperOrigin-RevId: 825223102
2025-10-28 15:14:27 -07:00
siddharth nohria
273fc3a8d4 Fix config_vars yaml file, and the generation script (#40766)
Add the missing use_system_roots_over_language_callback in the config_vars.yaml file, and add support for double types in the generation script.

Closes #40766

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/40766 from siddharthnohria:config_vars 1aff14e1d0781f20019181615c896e4be10c7dd7
PiperOrigin-RevId: 811847998
2025-09-26 09:30:31 -07:00
Adam Heller
f5ffef4d6b [test] Add PostMortem dumps on CHECK failures in test builds (#39945)
See `grpc_check.h`. This code  redefines the abseil `CHECK*` macros using custom gRPC macros when building tests. In `bazel test ...` builds, on check failure, `PostMortemEmit()` will dump state to the log before crashing.

Caveat: to prevent circular dependencies, code that `postmortem` relies on cannot use the custom gRPC CHECK macros. This is not much code, ~50 source files. grep for the `absl/log:check` bazel dependency.

Closes #39945

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39945 from drfloob:grpc_check ca8e46718f2021e0df79aa67a3a0b0c751b3ce44
PiperOrigin-RevId: 807452496
2025-09-15 17:43:19 -07:00
Craig Tiller
f83ae79333 [codegen] Fix interesting spelling of Shift 💩
PiperOrigin-RevId: 790025889
2025-08-01 22:36:44 -07:00
Vignesh Babu
f108df8850 [stats] Create utils to port stats generation into C++ from python.
The scopes in the python codegen is sorted to produce a deterministic output comparable to the C++ version.

PiperOrigin-RevId: 786768363
2025-07-24 11:09:02 -07:00
Craig Tiller
3bc21fa7b3 [trace] Migrate trace flag generation to C++
PiperOrigin-RevId: 784394099
2025-07-17 18:54:30 -07:00
Craig Tiller
fd65fc3580 [channelz] Remove Json from Seq
PiperOrigin-RevId: 777893437
2025-06-30 23:55:21 -07:00
Craig Tiller
e332379ea8 Allow Seq to be serialized to proto
PiperOrigin-RevId: 777636540
2025-06-30 10:57:31 -07:00
Craig Tiller
6baccc0192 [upb] Move generation from python to c++ (#39967)
This will allow us to run it from all docker environments, facilitating the generation of these files at build time on non-release branches.

Closes #39967

PiperOrigin-RevId: 776680199
2025-06-27 12:37:44 -07:00
Nana Pang
6a06e6f27f [Experiment Codegen Tool] Update the ExperimentOutputGenerator constructors to take const ExperimentsCompiler* instead of a const ExperimentsCompiler& to prevent binding to a temporary object that might be destroyed.
PiperOrigin-RevId: 772176045
2025-06-16 14:39:52 -07:00
Nana Pang
9d1ad1783b [Experiment Codegen Tool] Switch to absl::flat_hash_map instead of std::map for unordered maps in C++ experiment compiler.
PiperOrigin-RevId: 772166288
2025-06-16 14:14:37 -07:00
Sergii Tkachenko
18e0d14603 [Python] minor syntax improvements; follow up on black upgrade (#39820)
1. Follow up on comments in #39774.
2. Fix poorly formatted multiple assignment statements in src/python/grpcio/grpc/_channel.py (from the initial black migration).

Closes #39820

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39820 from sergiitk:python-minor-syntax-improvements 0d7ac578228b7ad837f16f27b84800bb3bebfabf
PiperOrigin-RevId: 771200864
2025-06-13 13:18:30 -07:00
Ashesh Vidyut
d312b25f71 [Python] Upgrade black (#39774)
### Description

* Upgrade Black to use the latest version. [Pypi-Black (25.1.0)](https://pypi.org/project/black/)
* Run `black` to reformat files to make the sanity tests pass in CI

**Note - all the file changes are by `black` command** except for the black version bump which is

https://github.com/grpc/grpc/pull/39774/files#diff-0512cc461bc04ba96303b81398cc5926bd16e120cbe48decd0c44ea0a8fb76e6R36

### Testing
CI

Closes #39774

PiperOrigin-RevId: 769640677
2025-06-10 08:24:10 -07:00
Vignesh Babu
53bc6c6440 [telemetry] Re-land https://github.com/grpc/grpc/pull/39530
PiperOrigin-RevId: 767711712
2025-06-05 12:17:24 -07:00
Nana Pang
070e4ceea9 [Experiment codegen tool] Update output format in C++ experiment compiler.
PiperOrigin-RevId: 767335533
2025-06-04 16:46:10 -07:00
Nana Pang
25d32e2506 [Experiment Codegen Tool] Remove status_helper dependency from C++ experiment compiler.
PiperOrigin-RevId: 767200557
2025-06-04 10:35:20 -07:00
Nana Pang
00ded1d567 [Experiment codegen tool] Update C++ experiment compiler to be comparable with Python experiment compiler.
PiperOrigin-RevId: 766386844
2025-06-02 16:26:26 -07:00
Nana Pang
c286931a7b [Experiment codegen tool] Fix a missing namespace comment in Python experiment compiler: tools/codegen/core/experiments_compiler.py.
PiperOrigin-RevId: 766263446
2025-06-02 11:04:55 -07:00
Craig Tiller
a5c01c3904 [chttp2] Huffman decoder - inline & re-evaluate parameters (#39468)
Add always inline to key methods in the Huffman decoder, and then re-run benchmarks and choose the best parameter set with the improved codegen.

Closes #39468

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39468 from ctiller:huff fa3434e6d9c5b9cfd621afe3809a935988d26dac
PiperOrigin-RevId: 765303408
2025-05-30 13:01:24 -07:00
Craig Tiller
fbce37dd3e [promises] Add Promise --> JSON conversion facility (#39580)
Just the genesis for the moment... but we'll extend this for all combinators to get introspection of state, and then make this available for all promise combinators.

Closes #39580

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39580 from ctiller:jsonp ccd76b74375c12331b8a079c95e417a9a94b33ff
PiperOrigin-RevId: 759436377
2025-05-15 21:39:58 -07:00
Vignesh Babu
788e5340b3 Automated rollback of commit 4a186266fd.
PiperOrigin-RevId: 758903258
2025-05-14 17:50:34 -07:00
Vignesh Babu
4a186266fd [telemetry] Change the schema of the stats_data definitions to better handle scoped metrics
PiperOrigin-RevId: 758840524
2025-05-14 14:44:08 -07:00
Nana Pang
3f325b759c [Experiment codegen tool] Update ExperimentsCompiler::ExperimentsOutputGenerator with const reference (const ExperimentCompiler&).
PiperOrigin-RevId: 755953166
2025-05-07 12:12:15 -07:00
Nana Pang
a5248ff9e9 Implement C++ experiment compiler. This is the initial step in migrating the gRPC Experiment Framework to a C++ compiler.
PiperOrigin-RevId: 754131557
2025-05-02 14:23:26 -07:00
nanahpang
e88d0c1a6e [Experiment codegen tool] Move experiments_compiler_test.cc to new folder. (#39449)
<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #39449

PiperOrigin-RevId: 754018350
2025-05-02 08:50:25 -07:00
Nana Pang
e33561615b [Experiment codegen tool] Enforce matching between rollout configurations and experiment definitions.
PiperOrigin-RevId: 753722080
2025-05-01 14:11:20 -07:00
nanahpang
5b53f77ba6 [Bazel RBE Non-Bazel Tests] Exclude //tools/codegen/core:experiments_compiler_test (#39369)
Exclude `//tools/codegen/core:experiments_compiler_test` from Bazel RBE Non-Bazel Tests, which contains some bazel hackery.

The actual `//tools/codegen/core:experiments_compiler_test` is added in https://github.com/grpc/grpc/pull/39133. Since that PR hasn't merged yet, this code uses a dummy test temporarily to allow test checks to pass.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #39369

PiperOrigin-RevId: 752349854
2025-04-28 10:06:44 -07:00
nanahpang
e753c162c1 [Bazel Test] Exclude //tools/codegen/core:experiments_compiler target from bazel test (#39337)
Exclude `//tools/codegen/core:experiments_compiler` target from bazel test, which contains some bazel hackery.

The actual `//tools/codegen/core:experiments_compiler` is added in https://github.com/grpc/grpc/pull/39133. Since that PR hasn't merged yet, this code uses a dummy target temporarily to allow test checks to pass.

<!--

If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the appropriate
lang label.

-->

Closes #39337

PiperOrigin-RevId: 750759908
2025-04-23 16:19:35 -07:00
Craig Tiller
ac90ebd310 [stats] Scoped histogram/counters (#39151)
Allow the core stats system to be used with scoped subsets of data - so we can start to collect some basic histograms/counters in the http2 stack for instance (or other transports, or channel level, etc...).

Collection of these has been optimized thoroughly already, and will be useful as a source of data for channelz and likely our other telemetry collection facilities.

Also allow scoped histograms to reduce the resolution stored -- instead of a full uint64_t, allow for instance a uint8_t - and re-scale values whenever things clip.

As a POC I've lifted a counter and associated histogram into the http2 stack.

Closes #39151

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/39151 from ctiller:scopez 3caccaecb72c239956959bddf611d68e4f66fe66
PiperOrigin-RevId: 744004944
2025-04-04 11:08:15 -07:00
Vignesh Babu
46e1f91e32 Restructure generation of stats data
PiperOrigin-RevId: 740802467
2025-03-26 09:47:51 -07:00
Craig Tiller
66a137f1d7 [sanity] Restore it (#38869)
Closes #38869

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38869 from ctiller:nubbins 972d734cdf45a4786de53c51b2ce8cf97a3d38ff
PiperOrigin-RevId: 731570368
2025-02-26 21:26:56 -08:00
Craig Tiller
07188632f4 Tiny formatting cleanups for portability
PiperOrigin-RevId: 731512282
2025-02-26 17:22:27 -08:00
Mark D. Roth
076d5076c6 [reorg] move security base APIs and credential code to new locations (#38825)
This includes the following moves from src/core/lib/security:
- certificate_provider/* → src/core/credentials/transport/tls/
- context/* → split between src/core/call/security_context* and src/core/transport/auth_context*
- credentials/
  - composite/ → split between src/core/credentials/call/composite/ and src/core/credentials/transport/composite/
  - alts, google_default, insecure, local, ssl, tls, xds → src/core/credentials/transport/
  - fake/ → split between test/core/test_util/test_call_creds* and src/core/credentials/transport/fake
  - external, iam, jwt, oauth2, plugin, token_fetcher → src/core/credentials/call/
  - call_creds_utils.* → src/core/credentials/call/
  - channel_creds_registry* → src/core/credentials/transport/
  - credentials.* → split between src/core/credentials/call/call_credentials.* and src/core/credentials/transport/transport_credentials.*
- security_connector/
  - alts, fake, insecure, local, ssl, tls → src/core/credentials/transport/
  - security_connector* → src/core/credentials/transport/
  - ssl_utils*, load_system_roots* → src/core/credentials/transport/tls/
- transport/ → src/core/filter/auth/
- util/* → src/core/credentials/call/

The only thing left in src/core/lib/security is the authz code, which I will move in a separate PR.

I have also moved the tests from test/core/security into a similar structure.  Some specific notes:
- I have removed print_google_default_creds_token.cc, since it does not appear in any build file and appears to be completely unused.
- I moved secure_endpoint_test.cc to test/core/handshaker, to match where the implementation lives in the tree.

Closes #38825

PiperOrigin-RevId: 731487339
2025-02-26 16:01:37 -08:00
Craig Tiller
94b9b62f67 [promises] Simplify switch debugging (#38755)
Switch to codegen so it's more obvious what goes on inside of a Switch function.

Closes #38755

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38755 from ctiller:switch cb2520c27f5f8360442ebd48b841fe08fe9316f2
PiperOrigin-RevId: 728712231
2025-02-19 09:59:39 -08:00
Craig Tiller
57a18b62ba Revert "[promises] Add an optimizer for Seq, TrySeq (#38445)" (#38748)
This reverts commit a7a650a74e.

Original PR breaks #38286 and I think the breakage is in the PR -- in a construct like:

```
TrySeq(
  /*a*/ []() -> Promise<absl::Status>,
  /*b*/ []() -> Promise<StatusFlag>,
  /*c*/ []() -> Promise<absl::Status>)
```

the original seq_state code would try to promote the intermediate `StatusFlag` to an `absl::Status` which is great - however with the optimization, if `b` is instantaneous we try to demote the result of `a` to `StatusFlag`, losing information.

I'll need to consider how to change this optimization to preserve the final output type before rolling forward.

Closes #38748

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38748 from ctiller:rb1 743eb33bdf7af0dacd7bef50d12411c30f2198ea
PiperOrigin-RevId: 727109120
2025-02-14 16:55:47 -08:00
Craig Tiller
518943adf1 [promises] Bring back non-copyable seqs/joins (#38744)
I made seqs/joins copyable a while ago in anticipation of a nice optimization -- that didn't pan out.

Having them copyable makes it more likely that `Loop` will accept them and try to turn them from promises into the promise factory that it expects, copying the insides... *which is usually wrong* and incredibly frustrating to debug.

Closes #38744

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38744 from ctiller:promising e7a0e8d0bbf084a764378a855c3e0ef8e5b66c6b
PiperOrigin-RevId: 727006243
2025-02-14 11:45:47 -08:00
Craig Tiller
a7a650a74e [promises] Add an optimizer for Seq, TrySeq (#38445)
Increasingly as we write sequences, we find ourselves writing some asynchronous parts interleaved with some synchronous parts. This PR seeks to provide a basic optimizer for sequences - it detects immediate returning promises (by the lack of a `Poll<T>` return type), and eliminates the state machinery required to evaluate them at compile time.

Closes #38445

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38445 from ctiller:optseq 81c5025d76fcfd7d286480836a948e7c5fad2ab8
PiperOrigin-RevId: 726641700
2025-02-13 14:39:56 -08:00
Esun Kim
780a9df654 [CI] Bumped Python to 3.8 (#38693)
Aligned with the minimum supported Python version. Changes:
- Removed python 3.7 installed from `python_debian11_default_x64` docker image.
  - Deleted `python_36.include` and `python_37.include` template files as they're no longer needed.
- Upgraded Python from 3.7 to 3.11 in `sanity` docker image.
  - Some Python modules were modified to accomodate this
  - Updated `buildifier` to v8.0.0 to have the same version that the CI tests use.
  - Python 3.11 is the system default, but Python 3.7 remains installed for `pytype` and `pylint` that cannot be upgraded yet.

Closes #38693

PiperOrigin-RevId: 724071015
2025-02-06 14:17:22 -08:00
Yash Tibrewal
c637de558a [Cleanup] Avoid std::make_pair (#38636)
Maybe in some of these cases, `{}` would work instead of `std::pair`, but I'm just doing a simple find and replace here.

Closes #38636

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38636 from yashykt:NoMakePair d819f6a74be2fb2859083436297f79ed3139a1b7
PiperOrigin-RevId: 722772621
2025-02-03 13:19:08 -08:00
Craig Tiller
bd945881ae [fuzztest] Add a domain for config vars (#38641)
This lets us finally get a list of experiments in human readable form, and tracers in the same, without the fuzzer having to learn the list of string forms of these types.

Closes #38641

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38641 from ctiller:config 4bb6eca121bdb4682fcabb20fe42c85e2294d3f7
PiperOrigin-RevId: 721822909
2025-01-31 10:40:21 -08:00
AJ Heller
478b4c0fba [C++17] Replace absl::optional with std::optional (#38420)
Closes #38420

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38420 from drfloob:cpp17-optional 7f276aaa3c493a2ea7f4f1766da975e083914a5b
PiperOrigin-RevId: 715081837
2025-01-13 13:13:38 -08:00
AJ Heller
6de27a09a7 [C++17] Replace legacy abseil attributes (#38422)
Closes #38422

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38422 from drfloob:cpp17-attributes 84e35b48451e80ff892bd83d0414336e0386f436
PiperOrigin-RevId: 714117191
2025-01-10 11:27:31 -08:00
AJ Heller
bd13a27610 [C++17] Replace absl::variant with std::variant (#38419)
absl::variant is a C++11 compatible shim for C++17's std::variant. See 2f016c4575/absl/types/variant.h (L38-L40).

Closes #38419

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38419 from drfloob:cpp17-variant 914ffd48413138458097b4726f89a58a48717154
PiperOrigin-RevId: 713817791
2025-01-09 15:38:32 -08:00
Craig Tiller
1d49120fd8 [experiments] Verify expiration date makes sense (#38301)
Closes #38301

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38301 from ctiller:expire 325fc80a3c7ac32711df963c673ac4801a01ee8f
PiperOrigin-RevId: 707680259
2024-12-18 15:07:56 -08:00
Mark D. Roth
7570d8b545 [reorg] move src/core/lib/config -> src/core/config (#37847)
Closes #37847

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37847 from markdroth:reorg_config 191c5460bc2b9c974bf76a3eedc876963d296f47
PiperOrigin-RevId: 698957093
2024-11-22 05:46:04 +00:00
Craig Tiller
bc35dc1aa7 [promise] better visibility into seqs (#38135)
VLOG is probably the wrong thing here (considering it's been requested explicitly via a trace)

Closes #38135

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38135 from ctiller:flake-fightas-26 52a78995d2822223c1cbc5a668dc34b178eb5ace
PiperOrigin-RevId: 697067177
2024-11-15 19:21:05 -08:00
Mark D. Roth
f6c57b6384 [reorg] move a bunch of stuff to src/core/util (#36792)
The following files have been moved:
- src/core/lib/avl/*
- src/core/lib/backoff/*
- src/core/lib/debug/event_log*
- src/core/lib/iomgr/gethostname*
- src/core/lib/iomgr/grpc_if_nametoindex*
- src/core/lib/matchers/*
- src/core/lib/uri/* (renamed from uri_parser.* to uri.*)
- src/core/lib/gprpp/* (existing src/core/util/time.cc was renamed to gpr_time.cc to avoid conflict)

Closes #36792

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36792 from markdroth:reorg_util d4e8996f481c611ffbb06a8b04924ff81bc1bc2b
PiperOrigin-RevId: 676947640
2024-09-20 13:19:02 -07:00