Explicit constructor ID for TL schemas #799
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This pull request is motivated by the need to enhance the clarity of the TON blockchain protocol by introducing explicit identifiers for constructors in the TL schema.
The initial schema, which was used as a prototype during active development, anticipated frequent changes to the network protocol. However, with the TON blockchain network protocol now in a stabilized state, it is imperative to incorporate specific constructor IDs. This allows third-party developers to navigate and debug their applications more effectively.
It is important to note that all identifiers for constructors are explicitly indicated in the Telegram production environment schema, which serves as a comprehensive reference for developers: https://core.telegram.org/schema.
By integrating explicit constructor IDs, this pull request aims to provide developers with a clear and standardized foundation for interacting with the TON blockchain network, promoting a more robust and developer-friendly environment.
Source of truth
The IDs provided were generated using the
tl-parser
CLI tool by Telegram team:https://github.com/tdlib/td/blob/master/td/generate/tl-parser/tl-parser.c
Example of usage:
How to check that Pfau didn’t break anything?
Just generate .tlo (binary serialized TL-schema) using old and new schemas:
And then check with
git diff
that the new generated.tlo
file under the new schema is the same as the old one.