contests | Неотсортированное

Telegram-канал contests - Telegram Contests

9250

This group is intended for discussions of coding and design competitions held by Telegram. Please use English. See @contest for information. For discussions in Russian, please use @contests_ru https://t.me/contests/51172

Подписаться на канал

Telegram Contests

I had everything done too with merkle proofing of blocks shards prooving then I was stuck at signatures in tact it may pass because tact doesnt manage errors well but in func it wont

Читать полностью…

Telegram Contests

this the message you must run checkDataSignature on

const message = Buffer.concat([
// magic prefix of message signing
Buffer.from([0x70, 0x6e, 0x0b, 0xc5]),
blockHash,
blockHeader.id.fileHash,
]);

this message is 544 bit checkDataSignature will hash it anyways but the signature are not for the hashed version of this but the raw one

Читать полностью…

Telegram Contests

It's possible
I used the checkDataSignature method, and it worked

Читать полностью…

Telegram Contests

Thnx for the clarification :)

Читать полностью…

Telegram Contests

Well, utime_since and utime_until are nice fields, but they do not guarantee anything at all. There are many different situations when they do not apply. I'd say rather utime_since is +- more reliable, but utime_until is not at all.

On the one hand the network may not work when utime_since happens, and the switching keyblock may happen later. Also, in theory, validators can be changed by any keyblock - any of which may change p34. However this should not cause any problems (well, noone can make a masterchain block if network is down).

On the other hand if elections fail (not enough validators for election) then current validators will validate beyond utime_since, until elections are conducted. This may also happen, if, for example, network goes down when elections should happen and validators cannot participate.

I once about 6 years ago had issue with that when I written my validator control software and relied on utime_until. That was a bad idea.

While this may be unthinkable on mainnet (but honestly, even there it happens), it may probably happen in the sidechain networks with which links are made using the bridge. Even fastnet had issues with stability during the contest.

And actually, in early days of mainnet (called testnet2 back then), there were several situations when the network was stormed and even TELEGRAM VALIDATORS (who were core and backbone of the network at that time) FAILED to participate in elections (I was validating 40% of the network for a cycle). Therefore... anything can happen.

So you can consider these as some kind of hints, but you may not rely on them. As for me, I ignored them because of all these factors.

Читать полностью…

Telegram Contests

it's impossible to check block signatures on tvm they are signature of a message that is 544 bits the fuction you used will hash the message before verifying (intended for check external messages that are normally hashed in 256bit) so they are two options either you did not test it or you just put it there in case it goes unseen by judges

Читать полностью…

Telegram Contests

if that's not winner of bridge contest, then who... https://contest.com/ton-trustless-bridge/entry6379

its so epic well done

Читать полностью…

Telegram Contests

I find out building optimizer over LLM to do it will be easier (for me) than do it myself 😁😜

Читать полностью…

Telegram Contests

I tried to optimize this function, when I failed after a lot of attempts I knew I can't do the task 😞

Читать полностью…

Telegram Contests

Yeah, utime_since, utime_until, but In this case, keyblock1 is the first keyblock of the epoch, it is signed by prev validators.
I can be wrong, btw, but in someones submisson I've read the same

Читать полностью…

Telegram Contests

Your explanation seems not correct to me, param 34 contains utime_since and utime_until( These parameters provide the time period during which these validators are active.), and these timestamps start at keyBlock1 and end at keyBlock2, which gives +1 to my hypotesis. On top of that when I made my system based on my understanding, validation worked fine (though I only tested at ~20 key blocks). Anyway thanks for attemp to help me.

Читать полностью…

Telegram Contests

As far as I researched, because I've never dived so deep into ton, it is not about mining new blocks, it is about election cycles.
So, keyblock1,2,3 of current epoch have same prev,cur validators, until next election cycle, than keyblock4 will have same prev/cur, but also next validator set.
But first keyblock of every "epoch"(prev/cur/next) is signed by validators of the past set.

Читать полностью…

Telegram Contests

You can actually do even better with absl::flat_hash_set. I've seen you did custom hash sets but I doubt they are faster than google's impl

Читать полностью…

Telegram Contests

Guys am I wrong or not; About how epochs work:
When key_block1 is mined it has current_validators who validate blocks until they validate next key_block2.

At some point key_block1 receives next_validators which is equal to key_block2's current_validators.

key_block2's prev_validators is equal to key_block1's current_validators.

Читать полностью…

Telegram Contests

Did it even compile after deletions? 😁
Did it help you compared to IDE's "Find all references" functionality?

Читать полностью…

Telegram Contests

Maybe if tvm offered a any bit check sig function it wouldve worked

Читать полностью…

Telegram Contests

i am sure it wont it makes no sense

Читать полностью…

Telegram Contests

So, keyblock is emitted only on config changes or there can be another situations?

Читать полностью…

Telegram Contests

Yeah, there is a little ambigous definition on this, technically, you can consider an epoch to be between two keyblocks that change p34, or you can consider it between any two keyblocks. In usual functioning of the network, each other keyblock does not change p34 - about 30 minutes (configurable, I think) The Elector concludes elections and asks The Config to put new vset into p36. This emits keyblock (as any config change), but p34 is not changed yet. Only the next keyblock actually results in p34 change.

Also, additional keyblocks, like changing of network configuration by vote results, should not change p34, but will be a keyblock, nevertheless.

But by definition in the contest we can only sync keyblocks one by one, so binding to previous keyblock number is situation dependent. As for me, I enforce the chain by checking new KB's previous KB always, and for ordinary MC blocks it is configurable.

Читать полностью…

Telegram Contests

so we either need TVM to allow us to check any size message or we need something else

Читать полностью…

Telegram Contests

assert(isSliceSignatureValid(material, signature, pubKey)) throw ERR_INVALID_SIGNATURE; this part wont work

Читать полностью…

Telegram Contests

is there a reference for the edit history?

Читать полностью…

Telegram Contests

That's one thing I guessed quickly after looking at lookup code and knowing there are a lot of lookups. I was wondering if we could traverse the entire dictionary and cache all the results 🤔
Unfortunately, my efforts were in a different direction which paid off just a tiny bit

Читать полностью…

Telegram Contests

Okay I apologize, I confused myself and want to sleep. Will try to investigate tomorrow, thanks anyway.

Читать полностью…

Telegram Contests

Though I only used current_validators and not two other lists

Читать полностью…

Telegram Contests

Actually web client already have a lot of icons as generated font, try "icon icon-folder-badge" as class for example. And they can simple be edited in figma.

Читать полностью…

Telegram Contests

The other thing there was DictionaryFixed::lookup which is very hot but split across multiple stacktraces so was kinda hard to notice in the profile. I think I got 20% speed up just by reimplementing it so that it doesn't allocate a million of temporary nodes

Читать полностью…

Telegram Contests

Please help if someone know this

Читать полностью…

Telegram Contests

so-so, it gave kinda intuition about codebase

Читать полностью…

Telegram Contests

I tried tracing TDesktop @3 icons from png to svg, they looked trash, so I guess the 8 icons is what we have to use unless they share us the svgs of all icons.

Читать полностью…
Подписаться на канал