Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit constructor ID for TL schemas #799

Open
wants to merge 2 commits into
base: testnet
Choose a base branch
from

Conversation

andreypfau
Copy link
Member

@andreypfau andreypfau commented Nov 18, 2023

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:

tl-parser -E lite_api.tl

How to check that Pfau didn’t break anything?

Just generate .tlo (binary serialized TL-schema) using old and new schemas:

tl-parser -e ton_api.tlo ton_api.tl

And then check with git diff that the new generated .tlo file under the new schema is the same as the old one.

@cryshado
Copy link

I think it's a very useful PR! Thank you

@the23x
Copy link

the23x commented Nov 18, 2023

We need it. We want it. Do it!

@shibdev
Copy link

shibdev commented Nov 18, 2023

The best PR ever(not scale)

@tvorogme
Copy link
Contributor

Seems to be good

@andreypfau andreypfau changed the base branch from master to testnet November 23, 2023 09:18
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.

5 participants