Scotbot: faster than ever, tags with capital letters will be accepted and claimed token are double checked

in scotbot •  5 months ago 

What is scotbot

Scotbot is the backend for all scot tribes which streams continuously steem blocks and parses all scot related comments/posts, votes and custom_json operations. scotbot keeps track of token vote power and the amount of pending tokens and when a post is paid out, it calculates the amount of tokens and adds them to the author and all voter as pending rewards which can be claimed.

Changelog

Speeding up scotbot

Finally, scotbot keeps track of the weighted rshares sum for all pending posts without recalculating them everytime from scratch. This is a huge step which reduces the delay of scotbot to around 15 to 20 seconds.

When a post is upvoted, rshares depending on the vote weight, power and staked tokens are added to the post and increase the amount of pending tokens. When the scot has a nonlinear reward curve, the rshares sum of the post is weighted by a non linear curve. pending_rshares is then the sum of all weighted rshares from all pending posts.

The reward of a post is calculated by:

weight_rshares / pending_rshares * reward_pool

Whenever a new vote arrives, the old and new weighted rshares is calculated, and the pending_rshares sum is corrected by:

pending_rshares  = pending_rshares  + weight_rshares - old_weight_rshares

When a post is paid out, its weighted rshares is subtracted from pending_rshares.

With these changes, it is not necessary anymore to go through all pending posts and sum up their rshares which is time consuming.

Converting all tags to lower cases

Before this change, scotbot could not regonize a post with a capital letter in the tag, e.g. Palnet instead of palnet. This is now fixed and tags are always converted to lower cases before checking them.

Checking if claimed token were correctly paid out

Before this change, scotbot was checking if a custom_json for issuing claimed tokens was broadcasted to a steem node without error.

After analyzing the logs, I found that it is not guaranteed that a broadcasted operation is written to the steem blockchain. In rare cases, it can be revoked and then the broadcasted custom_json cannot be found in the steem blockchain. Now, all broadcasted custom_json attempts and when found the matching custom json transaction id is stored in the database. Whenever a custom_json expires without finding a valid trx_id, the pending token amount is added again to the account and the user can claim a second time.

Conclusion

scotbot is faster than ever, allows tags with capital letters and double checks if claimed token are send out.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  
  ·  5 months ago Reveal Comment

Great stuff @holger80

Scotbot and steem-engine have opened up the eyes of the community to what can be done with Steem and kept us all interested during the winter.

It keeps me at least very busy :).

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!

That's lovely, keep it up

Hi, @holger80!

You just got a 3.77% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

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.188 which ranks you at #57 across all Steem accounts.
Your rank has dropped 1 places in the last three days (old rank 56).

In our last Algorithmic Curation Round, consisting of 181 contributions, your post is ranked at #1. Congratulations!

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • Great user engagement! You rock!

Feel free to join our @steem-ua Discord server

Great job and therefore a !BEER from me

To view or trade BEER go to steem-engine.com.

Hey @holger80, here is your BEER token. Enjoy it!