Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
In TON, how can we handle large amounts of data in messages? What are some techniques for efficiently storing and transmitting big data through messages?

In TON, messages are used to send data and instructions to smart contracts. Sometimes, these messages can contain large amounts of data such as media files, which can be difficult to store in a single message.

So, the question is asking how TON handles storing and processing large amounts of data within messages, and what strategies can be used to deal with this issue.

Votes Newest


Before we start, you need to know the message itself is sending on Cell data type in TON. Which means, each cell has a limit of 1023 bits for storing data. This limit includes the data stored within the cell and any necessary headers or metadata.

Suppose you have a message body that is 900 bits long, and you want to store it in a cell along with its message header. The message header itself will also take up some bits for storing its fields, such as message type, address information, and other metadata. When you try to store both the message header and the 900-bit message body in the same cell, the total number of bits required will exceed the 1023-bit limit of a single cell.

As a result, during serialization, a cell overflow exception will occur because the cell cannot accommodate more than 1023 bits of data.

To handle this situation, you need to store the message body in a separate cell, called a reference cell. In the message header, you would use a flag to indicate that the message body is stored in a reference cell. In this case, the "inplace message body flag" (which can have a value of 0 or 1) should be set to 1, indicating that the message body is not stored in the same cell as the header but in a reference cell.

By storing the message body in a reference cell, you can avoid the cell overflow exception and still store the entire message (header and body) within the constraints of the TON blockchain's cell structure.

Posted one year ago
1 Answer
one year ago
one year ago