What is SoftFork 0.22.2? A dive into the code

avatar
(Edited)

SoftFork 0.22.2 confused me as much as it probably did the rest of you, I slept through the fork and so I was very confused, let's take a look into the code:

/* If the time of the current block is more than the target SoftFork time */

if ( fc::time_point_sec( STEEM_PROTECTION_HARDFORK_TIME ) <= head_block_time() )
   {

Based on the kind of operation, block it if it's from a STEEMIT, Inc owned account and:

      switch( op.which() )
      {

It's a witness vote or proxy

         case operation::tag<account_witness_proxy_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< account_witness_proxy_operation >().account ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;
         case operation::tag<account_witness_vote_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< account_witness_vote_operation >().account ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;
         case 

It's a proposal vote

operation::tag<update_proposal_votes_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< update_proposal_votes_operation >().voter ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

It's a post vote

         case operation::tag<vote_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< vote_operation >().voter ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

It's a powerdown (you can powerdown to other accounts)

         case operation::tag<withdraw_vesting_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< withdraw_vesting_operation >().account ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

Trying to set powerdown route (account to powerdown to)

         case operation::tag<set_withdraw_vesting_route_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< set_withdraw_vesting_route_operation >().from_account ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

Trying to do a plain-old transfer

         case operation::tag<transfer_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< transfer_operation >().from ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

Trying to make a market order

         case operation::tag<limit_order_create_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< limit_order_create_operation >().owner ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;
         case operation::tag<limit_order_create2_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< limit_order_create2_operation >().owner ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

Powering up

         case operation::tag<transfer_to_vesting_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< transfer_to_vesting_operation >().from ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

Sending to savings

         case operation::tag<transfer_to_savings_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< transfer_to_savings_operation >().from ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

Using inbuilt escrow function of the chain to make a transfer

         case operation::tag<escrow_transfer_operation>::value:
            if ( hardforkprotect::get_steemit_accounts().count( op.get< escrow_transfer_operation >().from ) )
               FC_THROW_EXCEPTION(transaction_exception, "Error when pushing TX:\nReason: TX has been rejected.");
            break;

For any other transaction, allow (so long as all the other requirements are ok)

         default:
            break;
      }
   }

Hope this helps you to understand,
~ @CADawg



0
0
0.000
26 comments
avatar

You just received DERANGED @cadawg Keep up the great work. Congrats, you have been gifted 1 DerangedCoin. You can redeem 20 of them for an upvote from the deranged.coin account. Redeem your tokens by sending to deranged.coin through Steem Engine with your post URL in the memo field, view all your tokens at steem-engine.com

0
0
0.000
avatar

Wait, we can power down to other account? How can I do that? What tools can I use?

Also why is power up transaction also get blocked?

0
0
0.000
avatar
  1. SteemWorld -> Outgoing routes in balances tab ( https://steemworld.org/@fsm-liquid )
    image.png

  2. You can power up another account, so they could move funds that way.

0
0
0.000
avatar
  1. Thanks a lot!
  2. But it will be locked up for 13 weeks and visible on the chain though. Wow the witnesses really don't want Steemit to move funds at all.
0
0
0.000
avatar

No problem.

As for 2), think about it:

If steemit's accounts have lots of liquid, all they have to do is:

  1. Power up a new account
  2. Vote for own witnesses running 0.22.1
  3. Restore 0.22.1
  4. All funds unlocked
  5. Do whatever they were going to do anyway
0
0
0.000
avatar

Oh right, that's true. I wasn't thinking that far ahead.

0
0
0.000
avatar

Fair enough. Glad I could clarify. 👍

0
0
0.000
avatar

So this is what robbery looks like in code. #whoknew

0
0
0.000
avatar

#idid lol jk I don't even write c++ but eh I did it, correctly I think?

Glad I could shine a light on it for you!

0
0
0.000
avatar

Damn, pretty tight restrictions. Thanks for the nice breakdown! I'm curious though... What actions are left ( besides posting ) are they allowed to do? Just talk & sign messages? I guess send custom json as well, right? ( maybe Justin can still play splinterlands lol )

0
0
0.000
avatar

Yeah, anything that isn't directly transferring value/using SP, i.e. custom_json's are allowed, therefore they can use SE and SplinterLands (if they could transfer money to buy packs... lol)

0
0
0.000
avatar

Thanks for the share, though it still sounds strange for some of us.

Posted via Steemleo

0
0
0.000
avatar

Yeah, that's understandable.

0
0
0.000
avatar

Nice to see the set rules in raw form but only understood a few.

0
0
0.000
avatar

Nice to see the set
Rules in raw form but only
Understood a few.

                 - kayceefresh


I'm a bot. I detect haiku.

0
0
0.000