SteemFlagRewards Project Update: Code Review - Prepping for SFR CreditssteemCreated with Sketch.

in #utopian-io5 years ago (edited)

I have conducted a code review of the SFR bot. This will pave the way for future improvements and innovations. The foremost being the SFR credit system via our newly created Steem-Engine token.

image.png

1. Moved all rank-related lists to the config file.

     This included both mod and flagger ranks. This part of the report adds a nice visual element to what we do. I do imagine I will use these ranks for future role playing games. Let's just say I have a few ideas up my sleeve.

image.png
Mod Ranks

2. Updated Flagger Beneficiary Report Verbage

...Flaggers have been designated as post beneficiaries. Our goal is to empower abuse fighting plankton and minnows Steemians and promote a Steem platform that is less-friendly to abuse. It is simple. Building abuse fighters equals less abuse.

3. Redesigned Flaggable Post Query

     It now displays all flagged content that is less than 5 days old. This helps us to focus our voting power where it is most effective and avoid the late voting penalty. The entire query for flaggable posts is below. If you have any ideas, feel free to drop a comment.

    sql_flaggable = cursor.execute( #Queries obtains flagged posts within the 5 day mark for report includsion and action
        "SELECT DISTINCT CASE WHEN category LIKE '%nsfw%' OR category LIKE '%porn spam%' THEN '[NSFW link](https://steemit.com/' || post || '#' || comment || ')' " \
        "ELSE '[Comment](https://steemit.com/\' || post || '#' || comment || ')' END, '@' || approved_by, category, post, comment, " \
        "CASE WHEN category LIKE '%nsfw%' OR category LIKE '%porn spam%' THEN '[NSFW link](https://steemit.com/' || post || ')' " \
        "ELSE '[Comment](https://steemit.com/\' || post || ')' END " \
        "FROM steemflagrewards WHERE created > DATETIME(\'now\', \'-5 days\')")

4. Added batch method for mods to approve follow ons.

     This function allows to submit all child mentions for approval in batch. This greatly improved the amount of time it takes when a mod finds a post that has many flag mentions. It's a great timesaver so we can focus more on abuse fighting and related development. The downside is it has a tendency to affect the accounting of approvals. This is because we now track in two channels.

5. Insert Mention Function

     To condense our code, we have eliminated the repetion of database inserts. These inserts occur throughout our approval workflows. This was achieved by standardazing the queries. We took hard coded boolean values (True of False) and passed the variable as a parameter of said function. The greatly improves the readability of the code not to mention the amount of lines.

6. Export SFR Database to CSV function

     This function exports the SFR database as a comma separated values file. This allows performance of various types of analytics. The function was recently used to provide @imacryptorick with our flag data used in his recent SFR flag trail tutorial. I highly recommend giving it a look to better understand. It breaks it down quite well.

Summary of Code Review

  • 334 lines of code added or updated
  • 56 lines of code trimmed
  • 5 functions added
  • 1 DB Query updated

     This code review will help us prepare for the migration to the SFR credit system, a extensive undertaking in its own right. The DRY ("Don't Repeat Yourself") changes will ensure I only have to update the main bot code in 1 place instead of 7. If we ever need to add a column, this will reduce the time cost and chance for human error.

Because even though I am technically a cyborg, I still make mistakes.

     These things will help pave the wave for the implementation of the SFR credit system. On that note, I have developed about 50% of the functionality required which have been mentioned at greater length in this comment.

Links to all GitHub commits:

Moved all rank-related lists to the config file.
Updated Flagger Beneficiary Report Verbage
Redesigned Flaggable Post Query
Batch Follow On Approval
Insert Mention Function - DRY Principle
Updated Flag LeaderBoard / Added Mod Leaderboard
Removed extraneous variables from main script
export_sfr_db function / add paid column to db

Thanks for all that believe in and support the work we are completing together for this chain.

     It has taken a lot of time and effort for us to get this far and appreciate the community support / good vibes. I'm glad to add value to something that bolsters abuse fighting capability on chain. Like to think of what we do as force-multiplier of the stake we have assembled together as a community.

We can affect much greater change when we coordinate our efforts and our Steem Power together.

Would you like to delegate to the Steem Flag Rewards project and promote decentralized moderation?

It's much more fashionable than self-voting.

Here are some handy delegation links!

50 SP 100 SP 500 SP 1000 SP


New Supporter Incentives Coming!

I will be providing increased flag incentives to those that:


     This will improve our @busy.org support and flag capabilities. It is NOT a requirement but will be a perk for those willing to support. Furthermore, I will be working flagger / delegator incentives into the @steemflagrewards upvote algorithm. Stay Tuned.

Note: The primary incentive is reducing the profitability of abuse platform wide. This benefits all users of the Steem blockchain so please consider support.

Also, here is my SteemAuto fanbase link if you would like to be one of my consistent supporters.

Series Backlinks

Sort:  

Nice, can't wait to see it all in action!

Magic Dice has rewarded your post with a 73% upvote. Thanks for playing Magic Dice.

@pjau Do you think this comment is worth more than $10?
@steemflagrewards comment farming

How about I'm not going to beat around the bush, mkay?

There is WAY-WAY-WAY more VP abuse than SFR, spaminator & Steem Cleaners, altogether can handle. Meaning that we have to decide what abuse we prioritize at the moment. The average Steemizen isn't flagging what THEY themselves consider abuse, so you can imagine how little we can change at the moment.
Should @magicdice incentivize their players in a different way? Hell, yeah
Should SFR do anything about that? Definitely not in the foreseeable future, because that would make us extremely ineffective

Currently @spaminator has over 2.75 million vested with more than 99.5% VP and @steemcleaners has over 1.5 million vested with more than 96% VP so for them to ignore @magicdice reward abuse is either incompetence or more likely intentional negligence.

I've just begun looking into SFR and I am astonished at the reward pool rape and spam being facilitated by the account. This single post has over 20 comments and $18 in rewards saying the same thing - "Follow on flag for bid bot abuse"

https://steemit.com/life/@esbjornbo/cloudy-7ls7kexz#@themarkymark/re-esbjornbo-cloudy-7ls7kexz-20190409t025418553z

To my knowledge @steemcleaners are rarely at 100%, which is the point where SP is truly wasted.
I don't know if the same applies to @spaminator.
As I stated before, @anthonyadavisii is working on a steem engine token, to replace the current reward system, which has clear drawbacks.
@anthonyadavisii, can publish a post detailing what work needs to be done to officially publish the token? Maybe a few interesting Steemizens will volunteer to finish the job faster (I can upvote any post that showcases significant contribution to the upcoming SFR token code)

The scope of Spaminator is to go after faucet/post/comment farmers and similar. It precedes this new age of dapps and games, which so far we've been counting as "services" due to community input. Spaminator is currently being recoded and the new code is being tested, preparing it for another 3 years of cleaning.

The scope of Steemcleaners is to go after fraud, which is plagiarism, id theft or deception, image plagiarism of various kinds, security threats like phishing and similar. Additionally, it educates people regarding copy/paste.

Spaminator and Steemcleaners are different projects and we're hoping to get scope documentation out soon. If you want to make a recommendation, go for it. If you think there are dapps who exploit the goodwill of the ecosystem and spam up the chain, make a post about it.

I already have pointed out the abuse and if you aren't going to act then it's on you. Im not interested in jumping through any of your hoops. Steem is full of con artists, frauds, and grifters, and your network of so called spam fighters is just another gang of abusers disguised as heros with the momentum of self righteous group-think.

I have no idea who you pointed anything out to aside from the comment I responded to that was directly linked to me. We have a submission form for that. Use it or tag me in your investigation posts specifically if you find an issue that needs to be resolved.

If you're referring to magic-dice, the best solution is to hold them accountable and strongly encourage them to use the blacklist api feature.

Have you contacted @magicdice about $10 upvotes to random comments? I'll bet you haven't. It is no different than bid bot abuse, you pay for a chance of a profitable upvote and the more comment spam you put on the blockchain the better chance you have, right? The SFR trails are also spam and reward pool abuse and completely unnecessary. My contests that did not require any upvotes but allowed contestants the option to upvote or leave a comment are flagged to 0 while this type of abuse is being encouraged by the perpetrators. When you step outside of the comfort zone of your friend network you can see how hypocritical and insane that is.

I blame @magicdice on that one.

It's fun and all that, but it really rubs people the wrong way when they choose to randomly upvote their players' random comments like that.

So reward pool abuse is fine as long as votes are random? If reward size is too large that should be corrected with @spaminator, @steemcleaners, or @steemflagrewards right?

If you have a solution that doesn’t involve flagging random people, but send a message to @magicdice, let me know.

@spaminator flags random people constantly to remove excessive rewards regardless of where votes originate.

@skepticology I have no control over what @magicdice votes on. They randomly select someone that plays with a 1-100% vote on a random post.

I like playing the game, so should I stop playing it because you think the vote is wrong. Why don't you contact @magicdice and complain to them about it.


Here's your DRAMA. Don't spend it all in one place!

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

If you disagree with reward size then why not correct it with @spaminator or @steemflagrewards? Your complacency means that you are fine with reward pool abuse as long as you are the beneficiary.

Even if I wanted to flag it, I can't flag with @spaminator or @steemcleaners because it's not an abusive post. I posted that comment not knowing I would be upvoted at all, it is a response to @anthonyadavisii post, I didn't post it in the hopes of getting a $10 upvote. If you look at 99.9% of my comments since I joined Steem they get between 0 and and a few cents. How the fuck am I supposed to know if I'm going to get a $10 vote. I've rarely had votes of that size.

@spaminator or @steemcleaners do not deal with reward disagreements. They are used to flag abuse such as plagiarism and posts like yours which are designed to farm rewards on purpose. They serve zero value. If you want to run a contest, vote the winners with your own stake, or buy some Steem to hand it out as prizes, or find a sponsor. It's really that simple.

If you have an issue with who @magicdice decides to vote on, or how they decide to do it, then contact them and every single one of their delegators to propose a solution on how it could be done better instead of acting like a baby and blaming me for your abuse.


You're upping the drama to new levels! Have a DRAMA.

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

Your hypocrisy and cognitive dissonance are astounding.

Then, you clearly don’t understand the scope which those groups operate on. This is a @magicdice issue.

This falls under personal disagreement. You may flag at your own leisure.

Did @spaminator flag participants of your contest when you are the source of it?

Do you not flag posts for "bid bot abuse" because of excessive rewards even though the vote was from a different account? The #1 reason for a flag is "Disagreement on rewards." The rewards for this comment are excessive and abusive towards the rewards pool. It does not matter where the votes came from or whether or not they were random.

Do you not flag posts for "bid bot abuse" because of excessive rewards even though the vote was from a different account? The #1 reason for a flag is "Disagreement on rewards." The rewards for this comment are excessive and abusive towards the rewards pool. It does not matter where the votes came from or whether or not they were random.

Then flag it yourself. Do not tag SFR in your comments when you have never bothered to step inside our Discord to see how we define stuff.

Discord is an insecure 3rd party application irrelevant to this blockchain and there is no reason you cannot discuss it here where the actions in question have taken place unless you are afraid of public exposure. As the 'old' saying goes, "blockchain or it didn't happen."

Hi Anthony,
Every now and then, a code review is necessary. And since it's spring time in the US, spring cleaning is bound to happen.

Moving some things to the config file is a good move. It might be ok to move the report verbiage to the config file too...

Overall, SFR inner-workings are progressing. The less repetitive the code is, the easier is the maintenance.

Good luck on the SFR credits token!


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @lovenfreedom! Keep up the good work!

Soon...@steemflagrewards shall evolve into the next level.

Hey, @anthonyadavisii!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

I hear congratulations are in order. Hope all is well :)

Hi @anthonyadavisii!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hi, @anthonyadavisii!

You just got a 14.08% 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.

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.032
BTC 63517.53
ETH 3062.83
USDT 1.00
SBD 3.81