namoray / nineteen

nineteen
11 stars 24 forks source link

feat: consider miners smoothness; penalize non-smooth responses #96

Open edinhodiluviano opened 3 weeks ago

edinhodiluviano commented 3 weeks ago

feature: consider response smoothness and penalize miners that send rough responses.

Bonus: how to measure smoothness (5~10 min read): Measuring smoothness.pdf

namoray commented 1 week ago

Hi Edin, can you upload the pdf to google docs or a website so i can open it in the browser directly? @edinhodiluviano

namoray commented 1 week ago

Problem here is relying on 'number of tokens' in a response. I can just send 1 token per respone right next to eachotehr right?

edinhodiluviano commented 5 days ago

Hello @namoray, sure. Just did a quick&dirty upload to my aws account: http://jkyr9gx9vqbtbd33zbhm.s3-website-us-east-1.amazonaws.com/


Regarding the "I can just send 1 token per response right next to each other": of course you can. That response, however would be smother then sending all tokens just at the very end; but less smooth then a response that sends 1 token every 1/n interval during the entire response time.

Charts: 4 tokens, next to each other: image

4 tokens just at the very end (all in a single response): image

4 tokens equally distributed throughout the entire response time: image

And if we look at the code, it will also show that: if you run the below script (sorry, I changed it to .txt so github would accept upload it :upside_down_face: ) measure_smoothness.py.txt it returns:

calc_roughness(tokens_next_to_each_other)=0.64
calc_roughness(tokens_at_the_end)=0.72
calc_roughness(tokens_equaly_distributed)=0.48
calc_roughness_pct(tokens_next_to_each_other)=0.888888888888889
calc_roughness_pct(tokens_at_the_end)=1.0
calc_roughness_pct(tokens_equaly_distributed)=0.6666666666666666
edinhodiluviano commented 5 days ago

ps.: just synced with the source. Also fixed an error that would prevent the code to run (still not tested... :roll_eyes: )