Info

Pull request

https://github.com/ton-blockchain/ton/pull/149

Testing and Issues

You can test this entry and submit issues during the testing period of the Blockchain Contest contest.

Entries with serious issues will not be able to win the contest, but even minor issues might be important for overall results.

Voting

22

Comments

I've implemented manual DNS scm, but created PR rather than archive, cause thought that there were options (chose what you prefer). Hope it's not crucial, my submission hadn't to affect to the contestants cause was done close to deadline
Community, you provide me a few minuses without verbal feedback. It makes me sad. Could you write down your thoughts please, don't be shy )) If telegram decides to disqualify me (hope not) I will be enough punished anyway for my inattention. From the community I expect to get engineering view on the submission and of course your comments
A bit of advertising
I was using TDD approach for developing the smart-contract and the most time I've spent on creating the tools for it. Now you may use compile/test scripts with unified options no matter with what smartcontract. It was a crucial thing because without this approach it is really difficult to see edge cases (форма освобождает).
Why I've chosen bash as a wrapped script? First of all, I wanted to limit the number of steps for the end user. If we have code on fc, but a message on fif, it introduces 1 additional step to compile end message. With bash I was able to hide it. Second - bash is more readable and knowledgeable tool (maybe based on experience) then fift, so it allows me to construct the tool I want. In fact if I had task to unify approach with building/generating - I would choose bazel + Starlark as build tool (even for fift/func), and would like to recommend it to TON as a build tool rather CMAKE, but I wanted not to introduce additional tools and make submission as lightweight as possible
Also I wasn't familiar with blockchain technologies, lisp and assembler technologies before the contest. It was just an adventure. Checking other submissions I've got that my work is competitive and it makes me glad. But of course I am not able to see all works (but I will try), so please comment your thoughts (especially if you are an experienced developer in the subject). I was especially worried about performance cause lack of knowledge can lead me to use wrong data structures or use something inefficiently

Cheers
TO Chic Dolhin comment (сontinuation)

> You can put try/catch around

Have you handled the case? Interesting, I'm going to check your submission then and will share my thoughts

> Also do you really need update code

In my case, it was done for development, as drop-data. But rather then drop-data, updating code I think should be kept. Updating code lies in a different dimension then interface consistency. Also there is no reasons to break existed interface, rather then extend it
You have not added any comments yet...
by rating

Issues

Clever Turkey Nov 7, 2019 at 16:03
Manual DNS:
+ Support for partial matches.
- Cycle in dnsresolve is useless, because pfxdict_get_q immediately returns suitable prefix.
- There is no way to completely delete expired domains.
- add_resource_record doesn't check that zone_cs matches whole domain, i.e. suffix is empty.
- Sanity checks can be performed client-side, because all requests are signed. There is no reason to do them in the contract.
- When domain is found, but category is not found the returned length must be non-zero.
- Ability to change code of an inited smart contract is very dangerous.
10
Funny Owl Oct 18, 2019 at 06:57
I've replied here https://gist.github.com/JIoJIaJIu/6ae834517810220ff5ed57cfb1b66145

Telegram, could you please extend comment form with allowing more symbols and support Markdown
TODO: what about balance depletion on error

That's an actual problem. If I spot faulty transaction on chain, I can replay it and drain resources until you update seqno with another.

You can put try/catch around, but you'll loose error information. It would look like message was successfully processed. Alternative solution would be to send internal message to contract itself. So that seqno is updated, but the actual processing happens in another transaction. This way you can track the errors by following created message.

Also do you really need update code? It's a trust issue. If I make calls into your contract I expect it to behave the same way everytime. Code update introduces uncertainties, will it always behave the way I expect or maybe an author will change the rules later?
Funny Owl Oct 17, 2019 at 17:06
Hello Chic, first of all - thank you for your feedback, you are the first one!
> what about balance depletion on error

I wondered about it - how better to avoid this thing at first I put accept_message at the end of my message, but it's not really obvious for the developer. My TODO comment is mostly related to TON developer - maybe it's better to move out accepting_message out of the contract and execute it automatically on successful return code from message handlers? I even wanted to raise a question about it on github, but then I thought - maybe it was designed - if the message was parsed - gas should be paid even with the error. So it's an open question for me
I tried trycatch but it doesn't make sense. I just eat all of the erros. It's beter to transfer message into internal queue. Here is an explanation why you should not throw exceptions after accept. https://gist.github.com/rainydio/b59f20c2342c71c8d7df34e5795cf821
Funny Owl Oct 27, 2019 at 11:43
Hey Chic, I've only now seen your message (haven't checked submission long time), sorry for the delay
I've raised the issue on github about it after our first collaboration - https://github.com/ton-blockchain/ton/issues/159
Fill free to put your thought there
What about my opinion - I think it's not a bug for external messages, but it's a bug for internal ones. More accurate - it provides a place for a mistake. Based on the topic you may see that TON doesn't agree with me
Nobody added any issues yet...