ZephyrProtocol / zephyr

The Untraceable Stablecoin Protocol.
Other
105 stars 15 forks source link

Since the Osiris fork, Miner reward is completely broken #9

Closed blackmennewstyle closed 9 months ago

blackmennewstyle commented 9 months ago

I would like to report a worrisome issue since the Osiris fork, the miner reward is completely broken: Let's take a block before the Osiris fork (https://explorer.zephyrprotocol.com/block/1000) and let's have a look at the miner rewards distribution (https://explorer.zephyrprotocol.com/tx/43f6f488aef5aad2f13b163c7488666b90b19ba970737b964d520b9741b1d5cc) - The miner distribution seem correct: the first wallet received 95% of the miner reward and the second wallet received 5% of the governance fee i guess lol

Now let's take a block after the Osiris fork (https://explorer.zephyrprotocol.com/block/129038) and let's have a look at the miner rewards distribution (https://explorer.zephyrprotocol.com/tx/67b8958c8dae4d4d60be67a96b6286416345d225d1e6d4f9c326902734f32e41) - The miner distribution is incorrect: the first wallet received 94% and the second now received 6% lol

Why does the governance fee is more higher now and there is no mention of that increase anywhere online lol

fennzar commented 9 months ago

Hey there, I can see the confusion and granted; we could and should do a better job of showing this on the explorer.

Although I must be clear that the Miner reward is not completely broken.

Since v1.0.0 Osiris this has been the breakdown blockreward-withtitle-post-v1

Previously it was split 95/5. so on this tx: https://explorer.zephyrprotocol.com/tx/43f6f488aef5aad2f13b163c7488666b90b19ba970737b964d520b9741b1d5cc Yes indeed the miner (95%) + the governance (5%) = 100% of the block reward.

Now we have a 75% (miner)/5% (gov)/20% (reserve) split so on this tx: https://explorer.zephyrprotocol.com/tx/67b8958c8dae4d4d60be67a96b6286416345d225d1e6d4f9c326902734f32e41

The mining potion (75%) + the governance (5%) = 80% of the block reward - which is where you have gone wrong in your calculations.

This is what you did: 75/80 = 0.9375 (93.75%) 5/80 = 0.0625‬ (6.25%) Which is wrong.

Hope this makes sense.

Note - the reason why the reserve is not shown is simply because the reserve reward is not going to a zephyr address via a transaction, unlike the miner and governance reward. There is no address of/keys to the reserve and thus no transaction.

blackmennewstyle commented 9 months ago

Thank you for the reply, i have however a suggestion regarding the block reward returned by the node.

curl -X POST http://127.0.0.1:27767/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getblockheaderbyheight", "params": {"height": 42}}' -H 'Content-Type: application/json'
{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "block_header": {
      "block_size": 179,
      "block_weight": 179,
      "cumulative_difficulty": 39592,
      "cumulative_difficulty_top64": 0,
      "depth": 883,
      "difficulty": 263,
      "difficulty_top64": 0,
      "hash": "8bb8dacafc94ba8c9a69c923d6cb2d12b4332c53bcc33cf3176559edcacfdd97",
      "height": 42,
      "long_term_weight": 179,
      "major_version": 2,
      "miner_tx_hash": "e78de1d8e679f2162fbeaf4641ca682a9c3ae87797c91a3a5429d3a732608b4c",
      "minor_version": 3,
      "nonce": 68181,
      "num_txes": 0,
      "orphan_status": false,
      "pow_hash": "",
      "prev_hash": "9148c03c8c05d1de9b6ad2fa034c0b5cf1be5d4f2d52b7258220816f6b98220f",
      "pricing_record": {
        "moving_average": 0,
        "reserve": 0,
        "reserve_ma": 0,
        "signature": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
        "spot": 0,
        "stable": 0,
        "stable_ma": 0,
        "timestamp": 0
      },
      "reward": 17114679677762,
      "timestamp": 1700917708,
      "wide_cumulative_difficulty": "0x9aa8",
      "wide_difficulty": "0x107"
    },
    "credits": 0,
    "status": "OK",
    "top_hash": "",
    "untrusted": false
  }
}

Before the Osiris fork, the full block reward was returned, now it's just the Full Block reward minus the Reserve reward. I think it's a bad choice.

I think you should just return the full block reward all the time, whatsoever. And let everyone calculate the different reward manually on their side.

fennzar commented 9 months ago

Please note the following comments from my reply:

"we could and should do a better job of showing this on the explorer."

"Note - the reason why the reserve is not shown is simply because the reserve reward is not going to a zephyr address via a transaction, unlike the miner and governance reward. There is no address of/keys to the reserve and thus no transaction."

changing the response of getblockheaderbyheight is absolutely doable in the same vein, it is not so simple for the same reasons. But I will reiterate that we can and should do better showing this, if not just for avoiding any further confusion