create account

RE: Optimized processing new transactions and blocks. by smooth

View this thread on: hive.blogpeakd.comecency.com

Viewing a response to: @andablackwidow/optimized-processing-new-transactions-and

· @smooth ·
$0.70
Maybe it would be a good idea to tag plugin custom_jsons which need to be parsed by hived or hive core middleware differently from third party custom_jsons which don't (with potentially lower RC cost for the latter)?
👍  , , , ,
properties (23)
authorsmooth
permlinkrg7wzr
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-08-06 23:52:42
last_update2022-08-06 23:52:42
depth1
children4
last_payout2022-08-13 23:52:42
cashout_time1969-12-31 23:59:59
total_payout_value0.348 HBD
curator_payout_value0.347 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length216
author_reputation260,342,945,372,716
root_title"Optimized processing new transactions and blocks."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,501,453
net_rshares872,122,463,061
author_curate_reward""
vote details (5)
@andablackwidow · (edited)
$1.32
They are tagged differently. In current version only `delegate_rc_operation` (with `rc` tag) carries extra cost. All other custom_jsons are only charged base cost, no matter if they are those used by essential services like Hivemind or third party. (By "current" I mean HF26 version :o) )
👍  
👎  
properties (23)
authorandablackwidow
permlinkre-smooth-202287t2111427z
categoryhive-139531
json_metadata{"tags":[],"app":"ecency/3.0.24-surfer","format":"markdown+html"}
created2022-08-07 19:00:51
last_update2022-08-07 19:04:45
depth2
children3
last_payout2022-08-14 19:00:51
cashout_time1969-12-31 23:59:59
total_payout_value0.662 HBD
curator_payout_value0.662 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length288
author_reputation97,189,462,735,448
root_title"Optimized processing new transactions and blocks."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,520,950
net_rshares1,658,790,772,199
author_curate_reward""
vote details (2)
@smooth · (edited)
$0.21
I think we're talking past each other here. Currently all custom_jsons have to be parsed because they might be used by a hived or hivemind. What I'm suggesting is that custom_json be broken out into one kind that is parsed by core services, and another that can be used by third parties but is not parsed by hived or hivemind. The latter would presumably have lower CPU usage (almost none beyond the base to parse an op at all) and therefore could have lower RC cost.

I mean the latter doesn't even have to be json at all. It could be custom_text. We do have custom_binary (I guess this has lower cost, or it should), but people seem to prefer storing json/text rather than packing a binary.
👍  ,
properties (23)
authorsmooth
permlinkrg9mnq
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-08-07 22:04:39
last_update2022-08-07 22:05:42
depth3
children2
last_payout2022-08-14 22:04:39
cashout_time1969-12-31 23:59:59
total_payout_value0.105 HBD
curator_payout_value0.105 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length692
author_reputation260,342,945,372,716
root_title"Optimized processing new transactions and blocks."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,524,860
net_rshares265,311,334,919
author_curate_reward""
vote details (2)
@andablackwidow ·
$1.08
No, hived only checks if `json` field of custom_json is a valid UTF-8 JSON string. It does not build variant object out of that string in order to access its fields. To see if it might need to actually do that, it uses `id` field that is right there in the operation itself.

Moreover the execution time associated with it being custom_json is trivial in comparison with cost associated with the transaction. Validation, execution and RC handling of custom_json (yes, cost of calculating RC is also included in the cost of operations) all together take 1509 ns on average. On the other hand duplicate check, tapos check and charging for RC takes 6622 ns plus a whooping 94165 ns per signature. Transaction itself also costs some state (128 byte-hours) and history bytes (size of transaction). As you can see, even if we started to charge zero for execution of `custom_json_operation`, the difference wouldn't matter.

If you are thinking about looking for a way to speed up calculation of public keys from signatures (most obvious target when it comes to execution time), it would help all transactions and would be very welcome, however most of the cost of transactions with custom_jsons comes from history bytes, not execution time.

<sub>The timings are obviously constants - they don't depend on the hardware the node is run on, because otherwise nodes would constantly disagree on RC mana of users. They were collected by @gtg on average computer recommended for witnesses - see [issue #205](https://gitlab.syncad.com/hive/hive/-/issues/205). They are likely to be updated (lowered) with future hardforks as more powerful hardware is required to run  witness node.</sub>
👍  
👎  
properties (23)
authorandablackwidow
permlinkre-smooth-202289t01859284z
categoryhive-139531
json_metadata{"tags":["ecency"],"app":"ecency/3.0.24-surfer","format":"markdown+html"}
created2022-08-08 22:18:57
last_update2022-08-08 22:18:57
depth4
children1
last_payout2022-08-15 22:18:57
cashout_time1969-12-31 23:59:59
total_payout_value0.540 HBD
curator_payout_value0.541 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,675
author_reputation97,189,462,735,448
root_title"Optimized processing new transactions and blocks."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id115,556,309
net_rshares1,354,365,312,841
author_curate_reward""
vote details (2)