scotbot: huge speed boost

avatar
(Edited)

I worked on decreasing the delay of scotbot and finally I achieved some good results. The delay could be reduced from 50 seconds (somethings it was even 10-15 minutes) around 15 seconds.

Sending (transfer/issue) out claimed token is done in a separate loop now

The problem with sending token is that broadcasting a custom_json needs around 1-2 seconds and when the same token should be send to two different accounts, the delay is 3 seconds (only one custom_json in a block).

I improved this bottleneck by

  • Whenever a scot_claim_token custom_json is bradcasted, a new entry is generated in the internal database
  • The pending token are checked and transfered/issue in a seperate loop which does not block scotbot anymore
  • The blockchain is scanned if the operation is broadcasted to the STEEM blockchain
  • When a custom_json is not broadcasted (Due to low RC for example), it is flagged for manually review.

During implementing this, I build in a bug, which allows it to claim the same amount of token several times (only for scot token which transfer token). The bug is fixed by now.

I improved also the way how it is checked if a custom_json was correctly broadcasted.

Streaming of stake and delegate operation

Reading the wallet of all scot user took some seconds which has blocked scotbot in the past.

custom_json which are related to staking token and delegating them are now continuously parsed. Whenever a user increase the amount of staked token, scotbot will parse the custom_json and adapt the value in the database.

From time to time the token amount of all scot user is read from the steem-engine again, but this can be done less frequent than before which reduces the lag of scotbot.


I can view the entry in the scotbot database by http://scot-api.steem-engine.com/@holger80?token=LEO :

A few seconds after staking the 0.724 LEO, scotbot has updated its database (the amount is stored as integer):

Conclusion

The time delay between broadcasting votes and comments and showing them on a tribe website could be strongly reduced. It should be below 15 seconds right now.



0
0
0.000
16 comments
avatar
(Edited)

The problem with sending token is that broadcasting a custom_json needs around 1-2 seconds and when the same token should be send to two different accounts, the delay is 3 seconds (only one custom_json in a block).

Good news this can be improved with HF21 as it is raising the limit of custom_json per block.

During implementing this, I build in a bug, which allows it to claim the same amount of token several times (only for scot token which transfer token). The bug is fixed by now.

Can you tell how often this happened and for how much? This seems like a big issue. I know a few people have said they have been able to claim more than once.

The time delay between broadcasting votes and comments and showing them on a tribe website could be strongly reduced. It should be below 15 seconds right now.

LOVE THIS!

0
0
0.000
avatar

🙌🏽 You’re awesome! Thanks for working on these changes, we’ve gotten a lot of questions about speed /claiming, etc. excited to see how these changes impact the tribes

0
0
0.000
avatar

Thank you so much for participating in the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

0
0
0.000
avatar

,Awesome news!! This should enhance UE greatly, it's good to know that you are always working to please your customers, exactly what a successful business shall always do.

0
0
0.000
avatar

Great update but we want more! Even a few seconds wait is like forever to deal with our impatience. Hope you will find some way to make it real-time soon!

0
0
0.000
avatar

I see a lot of talk about SCOT lately, but I'm not sure exactly what this service/initiative is all about.

0
0
0.000
avatar

Very nice update, also please add "Claim All" feature

0
0
0.000
avatar

Hi @holger80!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 7.610 which ranks you at #48 across all Steem accounts.
Your rank has improved 3 places in the last three days (old rank 51).

In our last Algorithmic Curation Round, consisting of 243 contributions, your post is ranked at #76.

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

0
0
0.000