Beem 0.19.55: Beem Account.get_voting_power() method Not Functional on HF20 RPC Nodes

Project Information

Expected behavior

The Account.get_voting_power() method should return a float type variable representing the accounts current voting power. The methods comment is as follows:

Returns the account voting power in the range of 0-100%

Actual behavior

The error below is encountered when pointing to nodes on Hard Fork 20 ('0.20.2')

Traceback (most recent call last):
File "", line 1, in 
File "/usr/local/lib/python3.6/site-packages/beem/account.py", line 347, in get_voting_power
total_vp = (self["voting_power"] / 100 + regenerated_vp)
File "/usr/local/lib/python3.6/site-packages/beem/blockchainobject.py", line 207, in getitem
return super(BlockchainObject, self).getitem(key)
KeyError: 'voting_power'


It has come to my attention while troubleshooting issues with the @steemflagrewards bot that the get_voting_power() method does not appear to be functioning on HF20 RPC nodes. If you connect to https://api.steemit.com or https://rpc.buildteam.io, you may have noticed the error when you call the method.

Notice what happens when I connect to @gtg's node which is not on HF 20.


 >>> gtg
<Steem node=wss://gtg.steem.house:8090, nobroadcast=False>
>>> sfr_ab=Account('steemflagrewards',steem_instance=ab)
>>> sfr_gtg.get_voting_power()
97.03791088657408
>>> gtg.get_blockchain_version()
'0.19.12'
>>> norm.get_blockchain_version() #https://rpc.buildteam.io
'0.20.2'
>>> ab.get_blockchain_version() #https://api.steemit.com
'0.20.2'

Conclusion

As there are so many Steem blockchain application dependencies on Beem, if all RPC nodes are upgraded to HF 20, there will be a significant impact on any tools that leverage the get_voting_power() method. @steemflagrewards upvote queue functionality and thus our abuse fighting capability would be in a degraded state until a workaround is identified. For the time being, we are ok while @gtg's node is still on HF19 and we will work on finding another for redundancy.

I have notified @holger80 via DM and informed the Steem Devs discord and the Beem Discord of said issue. Thank you!

Sort:  
Loading...

Not sure about the state on 8 hours ago, but lightsteem looks like working okay.

Screen Shot 2018-09-22 at 1.31.25 PM.png


I think it was a node issue on that time?

Awesome. We're going to try that today. Think it would be smart for us to use multiple libraries with error handling so we are able to deal with these sort of issues.

The thing was how it affected both HF20. I'm going to see if I can check a third one for consistency sake.

Posted using Partiko Android

Thanks anythony, However make sure, lightsteem is not a drop-in replacement for Beem. It's way more lighter and lacking many shortcuts/helpers compared to Beem.

By the way, what does consider_regeneration entail? I've never seen that before.

Posted using Partiko Android

if it's false, then it gives the VP on the last vote time. :)

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

Coin Marketplace

STEEM 0.21
TRX 0.14
JST 0.030
BTC 69812.20
ETH 3376.99
USDT 1.00
SBD 2.78