create account

RC系统解密之最大MANA(max_mana) / 如何提升 by oflyhigh

View this thread on: hive.blogpeakd.comecency.com
· @oflyhigh ·
$48.76
RC系统解密之最大MANA(max_mana) / 如何提升
想必STEEM HF20以来最让人又爱又憎的东西莫过于RC系统了(Resource Credit System),爱它是因为它的引进会防止STEEM网络被滥用,为STEEM的可持续发展铺平道路;恨它是因为它曾给我们很多人带来困扰,尤其是对于一个SP小户而言,这个困扰可能至今尚未消除。

![](https://cdn.steemitimages.com/DQmWHdxn9UY33VPd2Q83ZuqT83f9uvtQPe9MCQHLctBA8vz/image.png)
(图源 :[pexels.com]( https://www.pexels.com/))

为了搞明白RC系统到底是啥玩意,我准备去刻苦学习一下,请不要鄙视我用刻苦这个词,因为对于一个半吊子程序员,要搞明白这个复杂系统的那怕一小小丁点功能,其实也是很困难的。

闲话少叙,之前STEEM的带宽系统(bandwidth)中,用户有一个可用带宽概念,简单来讲,就是对于某个用户而言系统中有多少带宽可以被使用。在RC系统中也有一个类似的概念,它的名字叫做***`max_mana`***。

以我的账户 @oflyhigh 为例,可以在steemd.com中查询到如下内容:
![](https://cdn.steemitimages.com/DQmSVYZ7ZdfJ8qQku7oPxsbGow3nFBfqqsPXRjmaPbuy8tP/image.png)
其中
>`max_mana	164,858,794,024,586`

看起来好长一串数字(是不是代表我有好多资源可用😀),那么这个***`max_mana`***是如何计算出来的呢?

通过阅读代码,我发现***`max_mana`***使用如下代码获取:
>`mbparams.max_mana = get_maximum_rc( account, rc_account );`

而***`get_maximum_rc`***的代码如下:
>![](https://cdn.steemitimages.com/DQmWdRVVUURJBqp9RrCSnWuNETpngEd2v5FABiTji9Lh5fw/image.png)

从中我们不难看出***`max_mana的计算规则`***:
* 当前用户持有的vesting_shares
* 减去用户代理出去的vesting_shares
* 加上用户收到的vesting_shares代理
* 加上***`max_rc_creation_adjustment`***
* 减去下次Powerdown要变现的vesting_shares

其它几项都好理解,但是***`max_rc_creation_adjustment`***这个是什么鬼?通过阅读代码我们不难发现,这个值是在创建RC账户时就被确定的了***`create_rc_account`***

>![](https://cdn.steemitimages.com/DQmVGa3Y1JyzUFngYX7w7PdFHfzmBgRPGXfKTLU79tErnU8/image.png)


>![](https://cdn.steemitimages.com/DQmZ7KHNPisNGQo8fdVf11PNgh6f5DB1TakdnnCafcrWRZD/image.png)

在***`create_rc_account`***的实现中
>![](https://cdn.steemitimages.com/DQmU7PgU2ADGdStmTJLxVSoQwwvRKdmA69UyvtPziag9STt/image.png)

通过上述分析,不难得出结论,***`max_rc_creation_adjustment`***就是注册RC账户时注册费(STEEM形式)按当时状况计算的***`vesting_shares`***。***`(这个也解释了为何有的用户持有0SP,但是RC还不少,因为注册费高呀)`***

所以***`max_mana的计算规则`***简单来讲就是:
>***`用户vests - 代理出去的vests + 收到代理的vests + 注册费vests + 下次power down vests`***

![](https://cdn.steemitimages.com/DQmYV1QUf6euBQwbo3vCv6zZeo7Cz2SCdDENw3GHpwPdN32/image.png)
(图源 :[pexels.com]( https://www.pexels.com/))

所以如果RC不够用,如何***提升`max_mana`的方法***就显而易见了(当然了,你RC够用就随便喽)
* Power up SP
* 减少对外代理
* 避免Power Down

# 参考链接

* https://github.com/steemit/steem
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 72 others
properties (23)
authoroflyhigh
permlinkrc-mana-maxmana
categorysteemdev
json_metadata{"tags":["steemdev","steem","rc","mana","cn"],"users":["oflyhigh"],"image":["https://cdn.steemitimages.com/DQmWHdxn9UY33VPd2Q83ZuqT83f9uvtQPe9MCQHLctBA8vz/image.png","https://cdn.steemitimages.com/DQmSVYZ7ZdfJ8qQku7oPxsbGow3nFBfqqsPXRjmaPbuy8tP/image.png","https://cdn.steemitimages.com/DQmWdRVVUURJBqp9RrCSnWuNETpngEd2v5FABiTji9Lh5fw/image.png","https://cdn.steemitimages.com/DQmVGa3Y1JyzUFngYX7w7PdFHfzmBgRPGXfKTLU79tErnU8/image.png","https://cdn.steemitimages.com/DQmZ7KHNPisNGQo8fdVf11PNgh6f5DB1TakdnnCafcrWRZD/image.png","https://cdn.steemitimages.com/DQmU7PgU2ADGdStmTJLxVSoQwwvRKdmA69UyvtPziag9STt/image.png","https://cdn.steemitimages.com/DQmYV1QUf6euBQwbo3vCv6zZeo7Cz2SCdDENw3GHpwPdN32/image.png"],"links":["https://www.pexels.com/","https://github.com/steemit/steem"],"app":"steemit/0.1","format":"markdown"}
created2018-10-12 01:24:06
last_update2018-10-12 01:24:06
depth0
children15
last_payout2018-10-19 01:24:06
cashout_time1969-12-31 23:59:59
total_payout_value36.942 HBD
curator_payout_value11.821 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,068
author_reputation6,370,635,159,246,323
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,111,917
net_rshares35,735,943,726,151
author_curate_reward""
vote details (136)
@ericet ·
$0.06
谢谢O哥~ 你知道rc的恢复速度是怎么计算了吗?感觉不是线性的
👍  
properties (23)
authorericet
permlinkre-oflyhigh-rc-mana-maxmana-20181012t020312264z
categorysteemdev
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["steemdev"],"users":[],"links":[],"image":[]}
created2018-10-12 02:03:12
last_update2018-10-12 02:03:12
depth1
children1
last_payout2018-10-19 02:03:12
cashout_time1969-12-31 23:59:59
total_payout_value0.047 HBD
curator_payout_value0.015 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length31
author_reputation195,650,625,080,393
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,113,655
net_rshares47,104,239,605
author_curate_reward""
vote details (1)
@oflyhigh ·
应该是和之前的BANDWIDTH以及Voting Power类似的算法
回头我确认一下
properties (22)
authoroflyhigh
permlinkre-ericet-re-oflyhigh-rc-mana-maxmana-20181012t150435889z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 15:04:36
last_update2018-10-12 15:04:36
depth2
children0
last_payout2018-10-19 15:04:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length43
author_reputation6,370,635,159,246,323
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,152,858
net_rshares0
@fr3eze ·
$0.06
干货满满!

Posted using [Partiko Android](https://steemit.com/@partiko-android)
👍  
properties (23)
authorfr3eze
permlinkfr3eze-re-oflyhigh-rc-mana-maxmana-20181012t033233843z
categorysteemdev
json_metadata{"app":"partiko"}
created2018-10-12 03:32:33
last_update2018-10-12 03:32:33
depth1
children1
last_payout2018-10-19 03:32:33
cashout_time1969-12-31 23:59:59
total_payout_value0.047 HBD
curator_payout_value0.015 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length75
author_reputation62,201,653,753,684
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,117,746
net_rshares47,038,453,326
author_curate_reward""
vote details (1)
@oflyhigh ·
过奖啦:)
properties (22)
authoroflyhigh
permlinkre-fr3eze-fr3eze-re-oflyhigh-rc-mana-maxmana-20181012t150556340z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 15:05:57
last_update2018-10-12 15:05:57
depth2
children0
last_payout2018-10-19 15:05:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5
author_reputation6,370,635,159,246,323
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,152,977
net_rshares0
@kirato ·
$0.22
感謝o哥的解說。我初步看sp有三位數字,就和沒有限制錯不多。

Posted using [Partiko iOS](https://steemit.com/@partiko-ios)
👍  
properties (23)
authorkirato
permlinkkirato-re-oflyhigh-rc-mana-maxmana-20181012t150620611z
categorysteemdev
json_metadata{"app":"partiko"}
created2018-10-12 15:06:21
last_update2018-10-12 15:06:21
depth1
children1
last_payout2018-10-19 15:06:21
cashout_time1969-12-31 23:59:59
total_payout_value0.166 HBD
curator_payout_value0.055 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length92
author_reputation38,636,263,090,516
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,153,009
net_rshares162,267,679,598
author_curate_reward""
vote details (1)
@sleepagent ·
Thank you for using @sleepagent bid bot serves.
This post has received a 100 % upvote from @sleepagent.
properties (22)
authorsleepagent
permlinkre-kirato-1539472362033
categorysteemdev
json_metadata{}
created2018-10-13 23:14:51
last_update2018-10-13 23:14:51
depth2
children0
last_payout2018-10-20 23:14:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length103
author_reputation-16,169,076,691
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,240,018
net_rshares0
@maiyude ·
$0.06
的确,这几天我弄个小号玩机器人,玩了几下RC不够用了。

什么时候这RC能代理能买卖?
👍  
properties (23)
authormaiyude
permlinkre-oflyhigh-rc-mana-maxmana-20181012t024703763z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 02:47:09
last_update2018-10-12 02:47:09
depth1
children1
last_payout2018-10-19 02:47:09
cashout_time1969-12-31 23:59:59
total_payout_value0.047 HBD
curator_payout_value0.015 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length43
author_reputation8,970,701,360,387
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,115,568
net_rshares47,089,043,932
author_curate_reward""
vote details (1)
@oflyhigh ·
自己玩的话,代理SP就好啦:)
properties (22)
authoroflyhigh
permlinkre-maiyude-re-oflyhigh-rc-mana-maxmana-20181012t150504702z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 15:05:03
last_update2018-10-12 15:05:03
depth2
children0
last_payout2018-10-19 15:05:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length15
author_reputation6,370,635,159,246,323
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,152,898
net_rshares0
@minloulou ·
$0.06
好好了解了, 但解決的方法不容易...
👍  
properties (23)
authorminloulou
permlinkre-oflyhigh-rc-mana-maxmana-20181012t025431388z
categorysteemdev
json_metadata{"tags":["steemdev"],"community":"steempeak","app":"steempeak"}
created2018-10-12 02:54:33
last_update2018-10-12 02:54:33
depth1
children2
last_payout2018-10-19 02:54:33
cashout_time1969-12-31 23:59:59
total_payout_value0.047 HBD
curator_payout_value0.015 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length19
author_reputation26,302,127,547,157
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,115,913
net_rshares47,056,379,372
author_curate_reward""
vote details (1)
@maiyude ·
两个字:
充钱
properties (22)
authormaiyude
permlinkre-minloulou-re-oflyhigh-rc-mana-maxmana-20181012t155745803z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 15:57:54
last_update2018-10-12 15:57:54
depth2
children1
last_payout2018-10-19 15:57:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation8,970,701,360,387
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,156,334
net_rshares0
@minloulou ·
我記得我有加上充錢這句,但好像沒上傳😂

Posted using [Partiko iOS](https://steemit.com/@partiko-ios)
properties (22)
authorminloulou
permlinkminloulou-re-maiyude-re-minloulou-re-oflyhigh-rc-mana-maxmana-20181012t160012777z
categorysteemdev
json_metadata{"app":"partiko"}
created2018-10-12 16:00:15
last_update2018-10-12 16:00:15
depth3
children0
last_payout2018-10-19 16:00:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length81
author_reputation26,302,127,547,157
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,156,458
net_rshares0
@rea ·
$0.06
感谢O哥"刻苦"学习为我们分析RC系统。感觉我还是没有听明白,呵呵。
👍  
properties (23)
authorrea
permlinkre-oflyhigh-rc-mana-maxmana-20181012t100724536z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 10:07:24
last_update2018-10-12 10:07:24
depth1
children1
last_payout2018-10-19 10:07:24
cashout_time1969-12-31 23:59:59
total_payout_value0.047 HBD
curator_payout_value0.015 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length34
author_reputation388,195,597,445,775
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,136,626
net_rshares47,074,312,591
author_curate_reward""
vote details (1)
@oflyhigh ·
哈哈,是我讲得不好😳
properties (22)
authoroflyhigh
permlinkre-rea-re-oflyhigh-rc-mana-maxmana-20181012t150531100z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 15:05:30
last_update2018-10-12 15:05:30
depth2
children0
last_payout2018-10-19 15:05:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length10
author_reputation6,370,635,159,246,323
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,152,945
net_rshares0
@sdream ·
__辛苦了!__ 👍 谢谢分享!

这个 RC 是防止垃圾泛滥的,但也限制了大家在Steem平台上的交互体验。一日一文,多次点赞是没问题,但是,发读文阅评就它就猛吃 RC。😢
properties (22)
authorsdream
permlinkre-oflyhigh-rc-mana-maxmana-20181012t161656329z
categorysteemdev
json_metadata{"tags":["steemdev"],"app":"steemit/0.1"}
created2018-10-12 16:16:57
last_update2018-10-12 16:16:57
depth1
children0
last_payout2018-10-19 16:16:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length87
author_reputation591,097,764,011
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd0
post_id73,157,396
net_rshares0
@xem ·
good job
properties (22)
authorxem
permlinkre-oflyhigh-rc-mana-maxmana-20181013t112447655z
categorysteemdev
json_metadata{"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["steemdev"],"users":[],"links":[],"image":[]}
created2018-10-13 11:24:48
last_update2018-10-13 11:24:48
depth1
children0
last_payout2018-10-20 11:24:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8
author_reputation134,364,713,630
root_title"RC系统解密之最大MANA(max_mana) / 如何提升"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,204,982
net_rshares0