#### Project Information * Repository: https://github.com/steemit/steem * Project Name: Steem https://github.com/steemit/steem/issues/3184 #### Expected behavior - SBD print rate should be 0% now. I believe this bug itself must be well-known now, so this is mainly for explanation in detail, and more importantly, some suggestions. This is a very important issue, so it shouldn't be fixed by a temporary measure. While I'm not sure this is intended or not, `get_feed_history()` shows `current_median_history` as the value already **discounted by the so-called haircut**. I think this is highly confusing and where all the mess begins. You shouldn't do that way. ##### Suggestions - Use non-haircut value for ``current_median_history`` for consistency - All other real history values are non-haircut values, as you can see on https://api.steemjs.com/get_feed_history. This inconsistency can create lots of confusions, e.g., recent asset value error (steemit.com) / voting value error (busy.org which they still have) - Witnesses still need to report non-haircut prices, which again is very inconsistent and confusing. (https://steemd.com/witnesses) - Introduce a new variable such as `"haircut discount"` and show the value on steemd and `get_feed_history` as well. - For instance, https://api.steemjs.com/get_feed_history should show "base": "0.328 SBD", "quote": "1.000 STEEM", "haircut": "0.796" - This makes the code much more readable and much less prone to bugs such as the current one. In reality, it might be already late to change the behavior of ``current_median_history`` in the code. Then introduce a new variable. In any case, UI (e.g., steemd.com) should show non-haircut value for the current feed price with haircut discount separately. #### Actual behavior SBD print rate is still 1%. This bug is due to separate and inconsistent calculations for `current_median_history` and `sbd_print_rate`. The `sbd_print_rate` is calculated here https://github.com/steemit/steem/blob/7ebe3f8bddf9e58c943618f55136db6330dd95a0/libraries/chain/database.cpp#L3761-L3783 The first problem is `current_median_history` is already haircut (which I don't recommend doing so in Expected bahavior), so `percent_sbd` can never surpass 10%. The second problem is due to the inflation between the time when `current_median_history` is calculated and the time when `update_virtual_supply()` (which updates `sbd_print_rate`) is called, `percent_sbd` is always strictly less than 10% just a bit. I explain this in more detail below. #### High-level > **update_median_feed()**; > **update_virtual_supply()**; > > clear_null_account_balance(); **process_funds()**; process_conversions(); process_comment_cashout(); process_vesting_withdrawals(); process_savings_withdraws(); process_subsidized_accounts(); pay_liquidity_reward(); **update_virtual_supply()**; > https://github.com/steemit/steem/blob/7ebe3f8bddf9e58c943618f55136db6330dd95a0/libraries/chain/database.cpp#L3093-L3104 As you can see in the above, `update_virtual_supply()` (which updates `sbd_print_rate`) is called twice. The problem is `update_median_feed()` limit the `current_median_history` so that `sbd_print_rate` at most 10% already. ``` price min_price( asset( 9 * gpo.current_sbd_supply.amount, SBD_SYMBOL ), gpo.current_supply ); if( min_price > fho.current_median_history ) fho.current_median_history = min_price; ``` > https://github.com/steemit/steem/blob/7ebe3f8bddf9e58c943618f55136db6330dd95a0/libraries/chain/database.cpp#L3269-L3272 Unless you're very lucky due to floating point precision error, `sbd_print_rate` is already strictly less than 10% in the first call of `update_virtual_supply()`. But even if you were very lucky, now `process_funds()` inflates the supply. (While there are other functions that change `virtual_supply` or `current_sbd_supply`, they don't change them in the direction of the `sbd_print_rate` increase. So let me skip too much details here.) Thus, in the second `update_virtual_supply()`, sbd_print_rate is always strictly less than 10% regardless of your luck :) #### How to reproduce Don't need to explain, since it's always happening now. #### Recording Of The Bug   > steemd.com #### GitHub Account https://github.com/economicstudio
author | blockchainstudio |
---|---|
permlink | why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions |
category | utopian-io |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["utopian-io","bug-hunting","steemit","steem","busy"],"users":[],"links":["https://github.com/steemit/steem","https://github.com/steemit/steem/issues/3184","https://api.steemjs.com/get_feed_history","https://steemd.com/witnesses","https://api.steemjs.com/get_feed_history","https://github.com/steemit/steem/blob/7ebe3f8bddf9e58c943618f55136db6330dd95a0/libraries/chain/database.cpp#L3761-L3783","https://github.com/steemit/steem/blob/7ebe3f8bddf9e58c943618f55136db6330dd95a0/libraries/chain/database.cpp#L3093-L3104","https://github.com/steemit/steem/blob/7ebe3f8bddf9e58c943618f55136db6330dd95a0/libraries/chain/database.cpp#L3269-L3272","https://github.com/economicstudio"],"image":["https://ipfs.busy.org/ipfs/QmVTTC8nzCPFvMc3wBvUhXjCa1XYWsNXXWdMaV1khSzccG"]} |
created | 2018-11-28 19:56:30 |
last_update | 2018-12-01 19:10:09 |
depth | 0 |
children | 9 |
last_payout | 2018-12-05 19:56:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 8.230 HBD |
curator_payout_value | 2.632 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 4,433 |
author_reputation | 178,988,499,015,921 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,059,060 |
net_rshares | 17,783,388,895,287 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
warofcraft | 0 | 27,249,931,258 | 20% | ||
arama | 0 | 1,203,366,427,821 | 100% | ||
eforucom | 0 | 23,879,944,378 | 1.22% | ||
busy.pay | 0 | 544,746,240,776 | 2.64% | ||
skan | 0 | 1,279,182,974,289 | 12% | ||
bree1042 | 0 | 29,483,229,785 | 25% | ||
codingdefined | 0 | 7,707,184,897 | 7.5% | ||
bramd | 0 | 1,510,697,308,025 | 20% | ||
crokkon | 0 | 58,174,676,260 | 50% | ||
espoem | 0 | 1,618,762,860 | 1% | ||
mcfarhat | 0 | 4,793,128,280 | 5.88% | ||
loshcat | 0 | 3,074,996,139 | 100% | ||
utopian-io | 0 | 10,877,779,920,520 | 8.08% | ||
jaff8 | 0 | 22,787,730,783 | 14.7% | ||
emrebeyler | 0 | 203,914,414,868 | 12% | ||
scipio | 0 | 118,723,036,569 | 50% | ||
amosbastian | 0 | 31,846,027,490 | 14.7% | ||
jesusjacr | 0 | 3,900,955,959 | 3% | ||
asaj | 0 | 2,982,752,001 | 14.7% | ||
fun2learn | 0 | 1,168,259,688 | 1.6% | ||
jjay | 0 | 419,947,524 | 100% | ||
karlitav | 0 | 2,026,137,640 | 30% | ||
joceo00 | 0 | 919,387,568,250 | 25% | ||
heterodox | 0 | 121,549,629,311 | 100% | ||
mythosacademy | 0 | 449,752,795 | 6% | ||
ryuna.siege | 0 | 208,975,396 | 100% | ||
kiwifi | 0 | 39,754,152,867 | 10% | ||
blockchainstudio | 0 | 9,183,142,575 | 100% | ||
anpigon | 0 | 41,135,891,788 | 100% | ||
v6476721 | 0 | 471,277,898 | 100% | ||
jisoooh0202 | 0 | 9,230,603,906 | 50% | ||
nailyourhome | 0 | 1,210,612,349 | 1.6% | ||
describedreef | 0 | 471,489,383 | 100% | ||
djane860 | 0 | 471,527,100 | 100% | ||
glory7 | 0 | 131,180,438,689 | 33% | ||
volare511 | 0 | 554,195,243 | 100% | ||
steemchoose | 0 | 13,672,237,897 | 0.7% | ||
bukio | 0 | 244,142,685,677 | 2.17% | ||
bluengel | 0 | 1,281,295,885 | 10% | ||
englishstudy | 0 | 21,054,617,884 | 75% | ||
bugshow | 0 | 326,395,960 | 100% | ||
delegate4upvot | 0 | 1,210,867,082 | 1.6% | ||
steem-ua | 0 | 188,109,009,996 | 1.51% | ||
petrjemson | 0 | 474,831,692 | 100% | ||
fullvote | 0 | 712,818,698 | 0.32% | ||
gomdory | 0 | 60,624,206,120 | 100% | ||
yongsam | 0 | 6,231,241,823 | 100% | ||
curbot | 0 | 2,277,676,359 | 100% | ||
deer3 | 0 | 4,184,834,221 | 100% | ||
steem.future | 0 | 3,381,403,351 | 100% | ||
chrnerd | 0 | 514,081,087 | 100% | ||
rainsnow | 0 | 271,687,302 | 100% | ||
bejust | 0 | 135,758,893 | 100% |
짱짱맨 νΈμΆμ μλ΅νμ¬ λ³΄ν νμμ΅λλ€. μ€λ λ μκ° λ§λλ λ² μ€νΈμ λ¬, [μ€νλ¬λ¬ μμ΄λλ νλ‘λͺ¨μ ](https://steemit.com/bukio/@bukio/46npo8)μ 첫λ²μ§Έ λμ νλ§€κ° μμλμμ΅λλ€. λΆμ΄μ€(@bukio)μ [[μ€νλ¬λ¬ μμ΄λλ] μ€νμ ν리μΈμΌ γμμ΄ μνκ³ μΆλ?γ](https://steemit.com/bukio/@bukio/7pazmx)λ₯Ό νμΈνμ¬, μ¬λ¬λΆμ΄ λ² μ€νΈμ λ¬λ₯Ό λ§λ€κ³ μμ΅μ κ°μ΄ λ리μΈμ. <center>**[γμμ΄ μνκ³ μΆλ?γ νλ§€νμ΄μ§](https://buk.io/@ka2279)**</center>
author | bukio |
---|---|
permlink | re-bukio-jjangjjangman-1543435905016 |
category | utopian-io |
json_metadata | "{"tags":["bukio", "jjangjjangman"],"app":"steemer/1.0"}" |
created | 2018-11-28 20:11:45 |
last_update | 2018-11-28 20:11:45 |
depth | 1 |
children | 0 |
last_payout | 2018-12-05 20:11:45 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 312 |
author_reputation | 11,545,563,591,097 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,059,675 |
net_rshares | 0 |
.
author | crokkon |
---|---|
permlink | re-blockchainstudio-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181201t190417398z |
category | utopian-io |
json_metadata | "{"app": ""}" |
created | 2018-12-01 19:04:18 |
last_update | 2022-09-18 10:08:30 |
depth | 1 |
children | 4 |
last_payout | 2018-12-08 19:04:18 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 5.223 HBD |
curator_payout_value | 1.628 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1 |
author_reputation | 81,214,366,861,104 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,209,662 |
net_rshares | 11,306,496,831,312 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yuxi | 0 | 30,336,199,283 | 100% | ||
codingdefined | 0 | 7,634,127,270 | 7.5% | ||
espoem | 0 | 8,233,357,598 | 5% | ||
utopian-io | 0 | 11,043,287,402,305 | 7.71% | ||
jaff8 | 0 | 75,811,587,033 | 50% | ||
emrebeyler | 0 | 122,768,289 | 0.01% | ||
sachincool | 0 | 30,049,208,884 | 100% | ||
amosbastian | 0 | 29,808,307,998 | 14.12% | ||
hakancelik | 0 | 81,213,872,652 | 100% |
Thanks a lot for your comment. Now I included github issue in my posts. This is my first utopian-io post so I'm not even sure I followed the direction well :) BTW, floating point isn't my main point at all :) I just mentioned that there is a very tiny chance that the bug may **not** occur due to floating point precision problem. I know, internal calculation is mostly done by integers, but A/B is basically floating point operation even if both A and B are integers, which may lead to some unavoidable error. Again that's not my main point at all. I agree that 1% isn't a big issue in practice. But in theory it's a big issue I believe. If one thing doesn't work as intended, who can believe the others work well? And that's why I suggested fixing it very carefully with enough time, not by a temporary measure. I still believe that the current inconsistent and not self-contained feed history is a pretty bad idea. I know Steemit is having a hard time, so maybe they don't have enough resources to handle this. I'm very sorry about it. I'm not sure if you work for Steemit too or not, but I presume you're close to them. One suggestion is that Steemit should admit that it isn't sustainable without ads. I worked at facebook before (now I'm in the academia) and that's why I have much interests in Steemit. A decentralized SNS/Blog without ads is too unrealistic to me. While Steemit pretends to be decentralized, they are actually very centralized imho. Then why not having ads before it's too late? Let's face the reality.
author | blockchainstudio |
---|---|
permlink | re-crokkon-re-blockchainstudio-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181201t192621166z |
category | utopian-io |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["utopian-io"],"users":[],"links":[],"image":[]} |
created | 2018-12-01 19:24:39 |
last_update | 2018-12-01 19:26:24 |
depth | 2 |
children | 2 |
last_payout | 2018-12-08 19:24:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,530 |
author_reputation | 178,988,499,015,921 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,210,263 |
net_rshares | 0 |
.
author | crokkon |
---|---|
permlink | re-blockchainstudio-re-crokkon-re-blockchainstudio-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181201t194223918z |
category | utopian-io |
json_metadata | "{"app": ""}" |
created | 2018-12-01 19:42:24 |
last_update | 2022-09-18 10:08:21 |
depth | 3 |
children | 1 |
last_payout | 2018-12-08 19:42:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1 |
author_reputation | 81,214,366,861,104 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,210,813 |
net_rshares | 0 |
Thank you for your review, @crokkon! Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-blockchainstudio-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181201t190417398z-20181203t205647z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.9"}" |
created | 2018-12-03 20:56:48 |
last_update | 2018-12-03 20:56:48 |
depth | 2 |
children | 0 |
last_payout | 2018-12-10 20:56:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 59 |
author_reputation | 152,955,367,999,756 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,312,377 |
net_rshares | 0 |
#### Hi @blockchainstudio! Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your **UA** account score is currently 4.223 which ranks you at **#2804** across all Steem accounts. Your rank has improved 4 places in the last three days (old rank 2808). In our last Algorithmic Curation Round, consisting of 339 contributions, your post is ranked at **#58**. ##### Evaluation of your UA score: * Some people are already following you, keep going! * The readers like your work! * Good user engagement! **Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
author | steem-ua |
---|---|
permlink | re-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181129t133430z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.9"}" |
created | 2018-11-29 13:34:33 |
last_update | 2018-11-29 13:34:33 |
depth | 1 |
children | 0 |
last_payout | 2018-12-06 13:34:33 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 635 |
author_reputation | 23,214,230,978,060 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,096,163 |
net_rshares | 0 |
Hey, @blockchainstudio! **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](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)). **Want to chat? Join us on Discord https://discord.gg/h52nFrV.** <a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
author | utopian-io |
---|---|
permlink | re-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181202t000822z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.9"}" |
created | 2018-12-02 00:08:24 |
last_update | 2018-12-02 00:08:24 |
depth | 1 |
children | 1 |
last_payout | 2018-12-09 00:08:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 598 |
author_reputation | 152,955,367,999,756 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,219,366 |
net_rshares | 0 |
Thank you and I just voted for @utopian-io :)
author | blockchainstudio |
---|---|
permlink | re-utopian-io-re-why-sbd-print-rate-is-still-1-despite-the-haircut-bug-report-explanation-and-suggestions-20181202t000822z-20181202t123157461z |
category | utopian-io |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["utopian-io"],"users":["utopian-io"],"links":["/@utopian-io"],"image":[]} |
created | 2018-12-02 12:32:00 |
last_update | 2018-12-02 12:32:00 |
depth | 2 |
children | 0 |
last_payout | 2018-12-09 12:32:00 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 45 |
author_reputation | 178,988,499,015,921 |
root_title | "Why SBD print rate is still 1% despite the haircut? Bug report, explanation, and suggestions" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 76,240,361 |
net_rshares | 0 |