Switching back to Mining from MiningStopping in same round

Why resuming mining (startMiningIntention) while having state MiningStopping is currently disabled?
Imagine this scenerio:

  • I have miner with UPS (which will hold miner for even longer than mining round).
  • Power wents down.
  • Automatically submit transaction stopMiningIntention()
  • Before mining round ends (I still have MiningStopping state) power is back
  • I would like to “cancel” stopping mining with startMiningIntention() but currently it is not allowed

Could that be changed? Or there are some reasons why it can’t be done?

EDIT:
@DEVs
If I may suggest something - you could add endBlock or roundSize to phala.round. Currently it is 600 but it may vary in future, right?

1 Like

I don’t want to admit but actually we would add the support of this if we have solved a problem. The state “MiningStopping” doesn’t contain the starting height. So whenever we switch to the stopping state, the starting height is dropped in the blockchain state. We cannot recover to “Mining(startHeight)” later.

This is not so hard to fix, but we see some very basic problems in the overall round design. And it turned out it’s very likely that we may abandone the round design completely. In other words, there may not be “mining round” in the future.

The problem of round design is that, it’s inevitable that we will have some pending changes accumulating within a round, and bring the computing pressure of the update logic in the first block of the next round. This is acceptable in our testnet, but if we got more miners (like 10k) in the mainnet, the wavefront will be problematic for our blockchain. This is especially a problem in parachain runtime, because it only gives the validators 0.5s to execute the runtime logic.

In the roundless design, we will allow miners to join and leave on-the-fly. But when a miner wants to exit, a cooling down period applies. This will also affect the staking, because we don’t want to give the stakers or the miners the opportunity to hurt each other by playing with the protocol.

The new design will come when we announce a big update to the tokenomics design. It should happen in this month.

1 Like

Thx for describing in details. I can’t wait for update :wink:

1 Like

领取的测试pha币1000个,挖矿挖了一个星期,显示仍然是1000个pha,如何才能知道是否挖矿成功呢