Info

Download ZIP (114.3 KB)

Testing and Issues

You can test this entry and submit issues during the testing period of the TON Trustless Bridge Challenge contest.

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

Voting

33

Comments

The CLI for building test messages is not implemented, but the functions for building test messages are implemented in lib/preparer.ts. An example of the usage of these functions can be found in the file lib/prepareTestData.ts
You have not added any comments yet...
by rating

Issues

It looks solid to me.

One thing that seems a bit quirky: in lite client, the sender needs to know the "signature_index" of each validator. Is there a guarantee that we can deduce the signature_index of any master chain block's signatures, or does the sender need to extract this from the specific key block?
Calm Turkey Feb 7 at 15:49
Yes, sender need calculate signature index by keys from validator set from key block. If you present on specific index signature from another validator, signature validation will not pass. An example of how to properly prepare signatures in function with name "prepareSignaturesFromBlock" in file lib\preaprer.ts
Lite-client.
In `set_new_data` function you calculate target_weight as `muldivc(total_weight, 2, 3)`. You use ceil round.
In `check_signatures` function you use `throw_unless(error::signatures_weight_not_enough, total_weight >= target_weight);`

Example. If total_weight == 12, than target_weight == 8.
Let in `check_signatures` total weight of signatures is 8.
In you solution is good block.

But it's bad https://github.com/ton-blockchain/ton/blob/master/crypto/block/check-proof.cpp#L659

So, you should use `muldiv(total_weight, 2, 3) + 1`
Calm Turkey Feb 9 at 07:28
Agreed
Transaction checker.
It's bad idea to handle bounced messages. Attacker can send internal message to your contract with op == 0xffffffff and clean all pending queries
Calm Turkey Feb 9 at 07:02
He can't, there is a check that bounced transaction is from lite-client address
Transaction checker.
It's really interesting that you give `path` in `ShardAccountBlocks` that is HashmapAugE.
You don't analize HashmapAugE. You just go through cells by refs, using `path` =)
But attacker can take random cell from `ShardAccountBlocks`. And your contract answers that is ok transaction. But it's not a transaction.
Calm Turkey Feb 9 at 07:10
Yes it is by design)) You can check for example multiple transaction at one time or you can check account state hash and etc. By fact you can check any of this information:
acc_trans#5 account_addr:bits256
transactions:(HashmapAug 64 ^Transaction CurrencyCollection)
state_update:^(HASH_UPDATE Account)
= AccountBlock;

_ (HashmapAugE 256 AccountBlock CurrencyCollection) = ShardAccountBlocks;
Solid implementation of lite-client and tx-checker, but "hints"-based tx-search in proof (insecure).

More info on issues: https://contest.com/docs/TrustlessBridgeChallengeAssessment
Nobody added any issues yet...