Skip to content

Commit a8c8a11

Browse files
Protocol Buffer TeamLogofile
authored andcommitted
This update addresses merge conflicts
PiperOrigin-RevId: 623514390 Change-Id: I80fa75dc9fcd7bc3d51906653008979adbc0ec31
1 parent e63bc72 commit a8c8a11

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

.github/workflows/gh-pages.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ jobs:
1414
contents: write
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818
with:
1919
submodules: true # Fetch Hugo themes (true OR recursive)
2020
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
2121

22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
2226
- name: Setup Hugo
23-
uses: peaceiris/actions-hugo@v2
27+
uses: peaceiris/actions-hugo@v3
2428
with:
2529
hugo-version: 0.121.2
2630
extended: true
@@ -32,7 +36,7 @@ jobs:
3236
run: hugo --minify
3337

3438
- name: Deploy
35-
uses: peaceiris/actions-gh-pages@v3
39+
uses: peaceiris/actions-gh-pages@v4
3640
if: github.ref == 'refs/heads/main'
3741
with:
3842
github_token: ${{ secrets.GITHUB_TOKEN }}

content/programming-guides/serialization-not-canonical.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,19 @@ allow for optimization opportunities.
3939
## Inherent Barriers to Stable Serialization
4040

4141
Protobuf objects preserve unknown fields to provide forward and backward
42-
compatibility. Unknown fields cannot be canonically serialized:
43-
44-
1. Unknown fields can't distinguish between bytes and sub-messages, as both
45-
have the same wire type. This makes it impossible to canonicalize messages
46-
stored in the unknown field set. If we were going to canonicalize, we would
47-
need to recurse into unknown submessages to sort their fields by field
48-
number, but we don't have enough information to do this.
49-
1. Unknown fields are always serialized after known fields, for efficiency. But
50-
canonical serialization would require interleaving unknown fields with known
51-
fields by field number. This would cause efficiency and code size overheads
52-
for everybody, even people who do not use the feature.
42+
compatibility. The handling of unknown fields is a primary obstacle to canonical
43+
serialization.
44+
45+
In the wire format, bytes fields and nested sub-messages use the same wire type.
46+
This ambiguity makes it impossible to correctly canonicalize messages stored in
47+
the unknown field set. Since the exact same contents may be either one, it is
48+
impossible to know whether to treat it as a message and recurse down or not.
49+
50+
For efficiency, implementations typically serialize unknown fields after known
51+
fields. Canonical serialization, however, would require interleaving unknown
52+
fields with known fields according to field number. This would impose
53+
significant efficiency and code size costs on all users, even those not
54+
requiring this feature.
5355

5456
## Things Intentionally Left Undefined
5557

@@ -66,4 +68,3 @@ allow for more optimization opportunities:
6668
To leave room for optimizations like this, we want to intentionally scramble
6769
field order in some configurations, so that applications do not inappropriately
6870
depend on field order.
69-

0 commit comments

Comments
 (0)