We may have just fixed a critical bug in Steem.

in #steem8 years ago (edited)

https://github.com/GolosChain/golos/pull/37

What happened

A few hours a go user penguins-cymbals issued a one-line patch that could change the tide of mining on steemit. You can view the patch here https://github.com/GolosChain/golos/pull/37/commits/1ccffb32af9972d25fae0f721215eb5d13a847b0
The implications of this patch can make mining distributed and democratic once again.

How this patch works

When you are mining on steem, ideally you want all cores of your machine working on different equations called hashes. If you have each core of your machine working on a different hash you are optimizing your time very well. What steem was doing before this patch was having every core do the same exact work. The patch makes it so each core is doing its own thing and not duplicating any other core.

The implications of this patch are that serious miners can see 8-times, 16-times, and even 32-times the amount of hashing power they had before. This will disrupt the gtx-rabbit duopoly on the steem mining queue. We will begin to see more people and more users mining again. This could potentially increase the price of steem and attract new users to SteemIt if we are lucky.

How to apply the patch

To apply this patch, follow these simple instructions.

git clone https://github.com/steemit/steem.git
git submodule update --init --recursive
cmake -DBOOST_ROOT="$BOOST_ROOT" -DCMAKE_BUILD_TYPE=Release .

Here is the important part.
Modify the file libraries/plugins/witness/witness.cpp and skip down to line 540.
Insert a new line and on it put the following code: thread_num++;
It should look like this

                return;
             }
          }
       } );
      thread_num++;
    }
}

(Thank you @contentjunkie)
Now you can return to the main steem directory where you ran the above code and run this line: make -j4

I now encourage you to follow any of the many mining guides on SteemIt, if you like you can follow mine.
https://steemit.com/steem/@picokernel/tutorial-mining-get-rich-the-old-fashioned-way

Closing

Thank you penguin, If you get in contact with me I can monetarily subsidize you for releasing this bug.

If you like the work I doing in the SteemIt community I would really appreciate a witness vote.

I am using the money to pay for my own work as well as community projects. My GPU miner bounty is still open and I have coordinated with other users to make sure they will still pay when one is released. I will be using my witness funds to provide liquidity on the internal market most recently. My witness node is picokernel and you can find my witness thread at https://steemit.com/witness-category/@picokernel/witness-application-nate-brune-developer-and-dedicated-steemite

Thank you for your time.

Sort:  

Very cool @picokernel, but how could a latent bug like this have not been obvious based on performance metrics analysis, just curious?

Unfortunately, this bug was introduced during a mining algo change. We all assumed that the hash rate dropped because of the fact that we changed the algo. It's just one of those things we all overlooked. Including me, I feel bad. I spent a lot of time looking at the algo and trying to figure out what the hack was. Oh well!

Gotcha @picokernel, well the good news is you guys fixed it and it's now in the rearview mirror, good job!!!

You're welcome. Feel free to contact me in steemit chat or golos chat under the pen name 'penguin', as I would certainly like to claim any associated bounty. :)

(Note: unfortunately I do not own the 'penguin' account here on steemit... that was a bit short sighted of me.)

Nice bro!!

Thank you so much !

I added it to the main post :)

I built a new miner with git - so it already had the patch. I updated an old one and spent 3 hours trying to figure out how I could know that the patched worked. Turns out my friend @contentjunkie already figured it out. I've tried it - it works. This is only if you are super anal - otherwise just run the 3 steps at the top and it will update your miner!

Good news! I'll turn on a miner and see how this patch does. Thanks for bringing this to Steemit. You've had my witness vote for a while.

How would it increase the price of steem if people are able to mine it faster?

The mining rate is fixed in terms of the Steem produced. It just allows people to mine more efficiently and compete better against GPU miners.

Ah, thanks for the education :)

This is a great find, but unfortunately even with the fix it seems people with private GPUs miners (gtx and rabbit) still have a big edge. Not quite as big as before, but still big. I think we need to push ahead with other solutions such as getting an open source GPU miner developed.

Thank you for sharing this:) Unfortunately I have already voted for the maximum number of people otherwise you would definitely get one of my votes.

Haha I know the feeling! It's tough to pick good ones, and I am sure you have.

Yes I'm happy with the people I have already picked and I would feel bad about deselecting them because they are all doing a good job. I just wish I could vote for more people! There are lots of good people like yourself that deserve a vote, unfortunately there will always be limited places.

Wow! This is great news. Can't wait to hear and see verification that this patch will break the rabbit/su monopoly on mining Steem.

Jeez, I am glad someone finally figured this out. That was really bugging me...........seriously, I hated seeing Rabbit and the other one dominating the mining queue. That sucked. Good job with this! I tweeted this post out too!