ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
243 stars 106 forks source link

Article about prefix dictionaries #455

Open ProgramCrafter opened 4 months ago

ProgramCrafter commented 4 months ago

Summary

I'd like to see an article describing how to use prefix dictionaries in FunC. If TVM doesn't work correctly with regards to that functionality, I'd like a bug filed.

Context

It seems impossible to use those dictionaries correctly, but they may be quite useful for gas optimization. For instance, @Gusarich, in a discussion related to subdomains, reported:

strange, but zero byte in the end doesn't help. likely I have a bug somewhere.

I can store "test\0", and then I'm also able to store "testA\0", but if I try to append "testAB\0" as well, then pfxdict_get starts raising errors

and it doesn't just return flag 0 altogether; it raises error (9: error while parsing a dictionary node label)

Learning goals

Usage of prefix dictionaries on FunC and offchain sides, their applications to storing dictionaries like subdomains and

References

Estimate suggested reward

  1. TON Standard Footstep NFT
  2. $600 in TON

Completion criteria

ProgramCrafter commented 4 months ago

I'm ready to work on this footstep.