Skip to content

feat(protocol): upgrade canonical schema to Layer 233 - #5

Merged
iamxvbaba merged 2 commits into
iamxvbaba:mainfrom
roon9e:feat/canonical-layer-233
Nov 6, 2026
Merged

iamxvbaba merged 2 commits into
iamxvbaba:mainfrom
roon9e:feat/canonical-layer-233

Conversation

@roon9e

@roon9e roon9e commented Nov 6, 2026

Copy link
Copy Markdown

Summary

Upgrades the canonical schema to Layer 233, imported from official Telegram Desktop ready@a6df181ac41763a9ff9edae264dad407fb1c35ec (the stable ready branch; dev@93624f698 has byte-identical api.tl). Exact profiles 225–232 remain generated.

Manifest provenance:

  • commit a6df181ac41763a9ff9edae264dad407fb1c35ec
  • blob 4e29f2deb45a083196a8c7ac09cdedf2600c1a10
  • sha256 c2bbefcaec3285ba46c8af8f429c7012fe5aea253fd16d4be089f91c7c3fa71e

Schema changes

  • channels.toggleForum gains the required sidebar:Bool and moves #3ff75734 → #a2952b54.
  • channel adds forum_sidebar:flags2.23?true, user adds bot_forum_sidebar:flags2.22?true (wire IDs unchanged).
  • 27 new constructors (bot-widget, widget-data, wallet UserWallet/WidgetQueryType, transcription) and 8 new messages.* methods.
  • Six new updates: updateEditForumTopic, updateBotWidgetQuery, updateInlineBotWidgetQuery, updateBotWidgetCopyQuery, updateMessageWidgetData, updateTranscribedAudioFile.

Review decisions (see _schema/layers/LAYER233_REVIEW.md)

  • channels.toggleForum.sidebar → reject for 225–232 (profile→canonical). A historical request cannot express the new required layout decision; defaulting it to false would let an old client silently overwrite the account's sidebar setting. This follows the only prior required-request-field decisions (inputStorePaymentAuthCode.premium_days, payments.getStarGiftWithdrawalUrl.tmp_password), which reject. The canonical→historical projection drops sidebar and emits the historical body.
  • channel.forum_sidebar, user.bot_forum_sidebar → drop for 225–232 (layout metadata only; wire IDs unchanged).
  • The six new updates → drop for 225–232. Every non-wallet update added in Layers 225–229 was dropped; only the Layer 230 wallet/TON-session updates reject.
  • New widget methods/types remain unavailable in historical profiles (mechanical, no alias/byte bridge).

Policy grows from 249 to 305 entries (8 request rejections + 48 update drops); 249 reviewed decisions retained unchanged, zero stale.

Verification

  • go generate . is deterministic (two runs byte-identical).
  • go test ./... -count=1, go build ./..., go vet ./gen ./gen/semantic ./cmd/gotdgen ./tlprofile ./mtproto ./tg pass, including the new tlprofile/layer233_test.go.
  • Re-measured locked budgets: 743 families, 2888 rewrite variants, 1181 unavailable variants, 266 body obligations, 4 result obligations, 2172/1193/1102 execution plans, 1544 typed codec wires, 399 unprofiled wrapper invariants.
  • The Layer 232 legacy-withdrawal oracle no longer expects exact profile 232 to admit the promoted SRP wire (it defines the temporary-password method instead).

No client UI session or deployment is part of this verification.

roon9e and others added 2 commits November 6, 2026 10:34
Protocol compatibility line. Canonical Layer 233 comes from official
Telegram Desktop ready@a6df181ac41763a9ff9edae264dad407fb1c35ec (the
stable ready branch; dev@93624f698 carries byte-identical api.tl). The
manifest locks Git blob 4e29f2d and
normalized SHA-256 c2bbefcaec3285ba46c8af8f429c7012fe5aea253fd16d4be089f91c7c3fa71e;
exact profiles 225-232 remain available.

- channels.toggleForum gains the required sidebar:Bool and moves to
  #a2952b54. A historical request is rejected at admission instead of
  defaulting a layout decision the client never sent, matching the only
  prior required-request-field decisions (inputStorePaymentAuthCode and
  payments.getStarGiftWithdrawalUrl). The canonical-to-historical
  projection drops sidebar and emits the historical #3ff75734 body.
- channel.forum_sidebar and user.bot_forum_sidebar drop for 225-232:
  unchanged wire IDs, layout metadata only, never leaked.
- The six new updates (updateEditForumTopic, updateBotWidgetQuery,
  updateInlineBotWidgetQuery, updateBotWidgetCopyQuery,
  updateMessageWidgetData, updateTranscribedAudioFile) drop for 225-232,
  matching every non-wallet update added in Layers 225-229; only the
  Layer 230 wallet/TON-session updates reject.
- tlprofile/layer233_test.go locks the canonical pair, the new-flag
  non-leakage, the toggleForum request policy and the six update drops.
  The Layer 232 legacy-withdrawal oracle no longer expects exact profile
  232 to admit the promoted SRP wire (it defines the temporary-password
  method instead).
- LAYER233_REVIEW.md records provenance, decisions and verification.

No existing update's pts/pts_count field changes; the MTProto transport
schema is unchanged.
Protocol compatibility line. Follow-up to the Layer 233 import.

- channels.toggleForum from profiles 225-232 now defaults sidebar to
  false instead of being rejected at admission. Every client in use
  sends #3ff75734 (Telegram Desktop 7.3.1 and Telegram Android 13.0.3
  at Layer 231, TDLib 1.8.69 at Layer 232), so rejecting it took forum
  toggling away from all of them, as the v1.6.0 withdrawal rejection
  did for gift export. sidebar is per-channel layout metadata and an
  old client only knows the list and tabs layouts, so false is the
  layout it chose. Precedent: keyboardButton.type (default adapter)
  and auth.sentCodePaymentRequired.premium_days (default).
- Regenerate tg, tg/e2e and mt from an LF checkout. The import ran on
  a CRLF checkout of gen/_template: go/scanner strips the \r from line
  comments, so go/printer skipped doc-comment reformatting and 1121
  files differed from an LF generation in comment layout only, which
  the check/gen job would revert. .gitattributes now pins *.tmpl to
  LF.
- layer233_test.go asserts historical admission as sidebar=false and
  that the six new updates drop inside an updates container while the
  neighbouring update stays.
- LAYER233_REVIEW.md and the layers README record the new decision,
  the pts gap that dropping updateMessageWidgetData leaves for
  historical sessions, the messageMediaWidget optional-field drop and
  the corrected counts (19 constructors and 8 functions).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants